Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

[Samba] Samba & Alternate Data Streams

276 views
Skip to first unread message

Marten Gajda

unread,
May 16, 2010, 5:20:01 PM5/16/10
to
Greetings,

I'm developing a FUSE-based file system which will be exported to the
Windows-world via Samba. My file system is emulating NTFS Alternate Data
Streams by creating the content of those files "on the fly" on access.
This works quite well with Samba 3.4.6 and the ":Zone.Identifier"
stream. But the Windows clients don't even try to access the
"SummaryInformation" stream (they do on Windows hosted shares). I guess
Samba is not "advertising" this feature or something like that. There
are other streams which are tried to access though.
Is it possible to enable this feature?

thanks

Marten
--
To unsubscribe from this list go to the following URL and read the
instructions: https://lists.samba.org/mailman/options/samba

zoolook

unread,
May 16, 2010, 8:20:02 PM5/16/10
to
Hello,

2010/5/16 Marten Gajda <marten...@fernuni-hagen.de>:
> Greetings,

I don't know if this is what are you looking for:

http://www.mail-archive.com/sa...@lists.samba.org/msg101989.html


Regards,
Norberto

Marten Gajda

unread,
May 17, 2010, 8:30:02 AM5/17/10
to
Thank you. Strange, I didn't find that myself. But nevertheless, it its
not really what I'm looking for.
I'd like to have the SummaryInformation stream being accessed like a
regular file. This is already working for the :Zone-Identifier stream
but Samba doesn't even try to access *:SummaryInformation files.

regards
Marten

Marten Gajda

unread,
May 17, 2010, 10:10:01 AM5/17/10
to
Ok, it seems it has nothing to do with Samba. I got it partially working.
After I implemented the ':{4c8cc155-6c1e-11d1-8e41-00c04fb9386d}:$DATA'
stream windows started scanning for a whole lotta streams (at least for
the directories). I'm optimistic, that I can get it to access the file's
alternate data streams too :-)
regards
Marten

Marten Gajda

unread,
May 17, 2010, 12:20:02 PM5/17/10
to
I still can't get it to work :-( .
As I guessed earlier it seems Samba is not advertising the
streams-feature. Using the Sysinternals Process Monitor I can see that
on my samba share "Named Streams" is not listed among the
FileSystemAttributes, whereas it is on a Windows XP share. I guess this
is the feature I need. Its absence might be the reason why windows
doesn't try to access some streams (it doesn't explain why it actually
tries to read some streams though).
Is there any way to enable this (preferably without hacking the samba
sources)
Any hints are welcome.

Marten

John Drescher

unread,
May 17, 2010, 12:20:02 PM5/17/10
to
On Mon, May 17, 2010 at 12:14 PM, Marten Gajda
<marten...@fernuni-hagen.de> wrote:
> I still can't get it to work :-( .
> As I guessed earlier it seems Samba is not advertising the
> streams-feature. Using the Sysinternals Process Monitor I can see that
> on my samba share "Named Streams" is not listed among the
> FileSystemAttributes, whereas it is on a Windows XP share. I guess this
> is the feature I need. Its absence might be the reason why windows
> doesn't try to access some streams (it doesn't explain why it actually
> tries to read some streams though).
> Is there any way to enable this (preferably without hacking the samba
> sources)
> Any hints are welcome.
>

I thought that the streams do not work without the streams_xattr
module. Did you set that up on your samba server?

John

Jeremy Allison

unread,
May 17, 2010, 1:00:02 PM5/17/10
to
On Mon, May 17, 2010 at 06:14:06PM +0200, Marten Gajda wrote:
> I still can't get it to work :-( .
> As I guessed earlier it seems Samba is not advertising the
> streams-feature. Using the Sysinternals Process Monitor I can see that
> on my samba share "Named Streams" is not listed among the
> FileSystemAttributes, whereas it is on a Windows XP share. I guess this
> is the feature I need. Its absence might be the reason why windows
> doesn't try to access some streams (it doesn't explain why it actually
> tries to read some streams though).
> Is there any way to enable this (preferably without hacking the samba
> sources)
> Any hints are welcome.

Do you have "vfs objects = streams_xattr" or "vfs objects = streams_depot"
set on the share ? You'll need this to map named streams to filesystem
objects on a POSIX system.

Jeremy.

Volker Lendecke

unread,
May 17, 2010, 2:40:01 PM5/17/10
to
On Mon, May 17, 2010 at 06:14:06PM +0200, Marten Gajda wrote:
> I still can't get it to work :-( .
> As I guessed earlier it seems Samba is not advertising the
> streams-feature. Using the Sysinternals Process Monitor I can see that
> on my samba share "Named Streams" is not listed among the
> FileSystemAttributes, whereas it is on a Windows XP share. I guess this
> is the feature I need. Its absence might be the reason why windows
> doesn't try to access some streams (it doesn't explain why it actually
> tries to read some streams though).
> Is there any way to enable this (preferably without hacking the samba
> sources)
> Any hints are welcome.

Try

share:fake_fscaps = 262144

Volker

Marten Gajda

unread,
May 17, 2010, 3:50:03 PM5/17/10
to
Am 17.05.2010 18:18, schrieb John Drescher:
> I thought that the streams do not work without the streams_xattr
> module. Did you set that up on your samba server?
>
>
I don't have any vfs module enabled. So at least some streams do work
without streams_xattr. As I already mentioned the :Zone-Identifier
stream is working to a certain degree.
If I store a file (with Firefox) on the share this stream is created and
the explorer property sheet evaluates its content and tells me the file
is from the internet (I can "unlock" the file too).
It also works if I manually fakes the file's origin. But on the other
hand, this stream is not created when I copy a file from another NTFS drive.
As there is no use for xattrs in my file system I'd like to get this
stuff working without them.

Marten

Jeremy Allison

unread,
May 17, 2010, 4:00:02 PM5/17/10
to
On Mon, May 17, 2010 at 09:42:44PM +0200, Marten Gajda wrote:
> Am 17.05.2010 18:18, schrieb John Drescher:
> > I thought that the streams do not work without the streams_xattr
> > module. Did you set that up on your samba server?
> >
> >
> I don't have any vfs module enabled. So at least some streams do work
> without streams_xattr. As I already mentioned the :Zone-Identifier
> stream is working to a certain degree.

Not correctly, and I don't see how to be honest.

> If I store a file (with Firefox) on the share this stream is created and
> the explorer property sheet evaluates its content and tells me the file
> is from the internet (I can "unlock" the file too).
> It also works if I manually fakes the file's origin. But on the other
> hand, this stream is not created when I copy a file from another NTFS drive.
> As there is no use for xattrs in my file system I'd like to get this
> stuff working without them.

Can't be done. You need to have either the streams_xattr
module or streams_depot module enabled to get streams
support. Where do you think the stream data will get stored on
the filesysytem if you don't enable either of these ?

Jeremy.

John Drescher

unread,
May 17, 2010, 4:10:02 PM5/17/10
to
On Mon, May 17, 2010 at 3:59 PM, Marten Gajda
<marten...@fernuni-hagen.de> wrote:

> Am 17.05.2010 18:56, schrieb Jeremy Allison:
>> Do you have "vfs objects = streams_xattr" or "vfs objects = streams_depot"
>> set on the share ? You'll need this to map named streams to filesystem
>> objects on a POSIX system.
>>
>>
> I didn't enable any of them. That's why I'm wondering that some streams
> actually do work for me. The way streams are currently handled (just
> like regular files) is quite sufficient for me. Its just that samba does
> not advertise this feature.
> I didn't know about the streams_depot so far. Is there any documentation
> about the stream naming scheme within the depot directory?
>
http://www.samba.org/samba/docs/man/manpages-3/vfs_streams_depot.8.html

John

Message has been deleted

Marten Gajda

unread,
May 17, 2010, 6:40:01 PM5/17/10
to
Am 17.05.2010 20:37, schrieb Volker Lendecke:
> Try
> share:fake_fscaps = 262144
>
>
Ok, that enabled the "named streams" capability and
QueryStreamInformationFile is called now. But still the "Summary"
property sheet is not visible for files on my share. Obviously it is not
as easy as I was hoping.
I think I'm going to try the streams_depot soon.

btw.:
Strange enough, but the Zone-Identifier stream now fully works, even
without faking the fscaps or any vfs module. It turned out there was a
bug in my code, so that the stream content wasn't always interpreted
correctly. I can copy files from other volumes and Windows still knows
that its from the internet.

thank you,

Marten

Marten Gajda

unread,
May 17, 2010, 7:00:02 PM5/17/10
to
Am 17.05.2010 21:50, schrieb Jeremy Allison:
> On Mon, May 17, 2010 at 09:42:44PM +0200, Marten Gajda wrote:
>
>> I don't have any vfs module enabled. So at least some streams do work
>> without streams_xattr. As I already mentioned the :Zone-Identifier
>> stream is working to a certain degree.
>>
> Not correctly, and I don't see how to be honest.
>
The Zone.Identifier indeed is fully working now. Even if I copy a
downloaded executable from another volume I get a warning when I open
the file. In the logs of my file system I can see the creation of the
stream. It is treated just like a regular file. The difference is: my
file system doesn't list the ADS files.

>> If I store a file (with Firefox) on the share this stream is created and
>> the explorer property sheet evaluates its content and tells me the file
>> is from the internet (I can "unlock" the file too).
>> It also works if I manually fakes the file's origin. But on the other
>> hand, this stream is not created when I copy a file from another NTFS drive.
>> As there is no use for xattrs in my file system I'd like to get this
>> stuff working without them.
>>
> Can't be done. You need to have either the streams_xattr
> module or streams_depot module enabled to get streams
> support. Where do you think the stream data will get stored on
> the filesysytem if you don't enable either of these ?
>
>
They could be stored like regular files among the other files. Actually
that's exactly what samba was trying to do (without these modules), and
that's how I learned about the existence of ADS. I was wondering what
strange file names appeared in my logs after upgrading from samba 3.0.37.
My file system knows about (some) streams and doesn't list them,
although you can read and write them. But I have to admit that Samba had
a hard time to know which streams exist if they are not listed.
I'll have a look at the streams_depot module.

regards

Marten

Jeremy Allison

unread,
May 17, 2010, 7:10:02 PM5/17/10
to
On Tue, May 18, 2010 at 12:58:09AM +0200, Marten Gajda wrote:

> They could be stored like regular files among the other files.

Then they're regular files, not alternate data streams. That
makes no sense.

Marten Gajda

unread,
May 17, 2010, 7:30:02 PM5/17/10
to
Am 18.05.2010 01:00, schrieb Jeremy Allison:
> On Tue, May 18, 2010 at 12:58:09AM +0200, Marten Gajda wrote:
>
>
>> They could be stored like regular files among the other files.
>>
> Then they're regular files, not alternate data streams. That
> makes no sense.
>
>
I guess that's exactly what they are in a "streams_depot", except that
they are stored in a different directory. Also, these file's names
always contain a ':' which makes them different as this is not allowed
in regular windows file names. So files with a ':' could be treated as
ADS if there is a file (or directory) with a matching "base name" (i.e.
the part before the first ':') in the same directory.
Of course this could break some existing shares which already have file
names containing a ':' . But (as far as my experience goes) file names
containing illegal characters get mangled to some cryptic string which
makes them pretty useless anyway.

regards

Marten

0 new messages