[Box Backup-dev] Windows ACLs

Ben Summers boxbackup-dev@fluffy.co.uk
Tue, 28 Feb 2006 09:15:51 +0000


On 27 Feb 2006, at 22:46, Chris Wilson wrote:

> Hi Ben,
>
> On Sun, 26 Feb 2006, Ben Summers wrote:
>
>>>  Does anyone have any suggestions as to how Windows ACLs, owner  
>>> and group  should be stored by Box?
>>
>> Err... see BackupClientFileAttribute.cpp. Note how the first  
>> member of attr_StreamFormat is AttributeType. I suggest you add  
>> ATTRIBUTETYPE_WINDOWS and then create a attr_StreamFormat_Windows  
>> which contains whatever information you need.
>
> OK, thanks. I will need to write a number of arbitrary-sized  
> objects in
> the attribute, and I'm not comfortable with null-terminated strings  
> like the symlink target in attr_StreamFormat. Ideally I'd like to  
> use something like the Archive or Protocol interface to write  
> arbitrary objects to a memory buffer, and then read out the whole  
> memory buffer as an opaque block (and vice versa). However I can't  
> see any combination of existing classes that would allow me to do  
> that.

CollectInBufferStream

>
> Creating a StreamableMemBlock, and then a MemBlockStream on top,  
> would seem to work for reading out a data block into separate  
> components, but not the reverse: MemBlockStream::Write always  
> throws an exception, although the comments in the source seem to  
> indicate that it was intended to have a write phase and a read phase.

Copy and paste error from CollectInBufferStream, I think. All those  
comment blocks take quite a bit of time to create. :-(

>
> Is there another way to achieve this? Is it functionality that was  
> intended to be implemented at some point, but nobody got around to  
> it yet? Should I try to implement it myself?

If you think there's something "obvious" missing, do check carefully.  
I've been using these libraries long enought to have caught most of  
the essentials.

   http://bbdev.fluffy.co.uk/svn/box/trunk/docs/common/

Although it looks like my names may not be the most obvious choices.

Ben