You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@directory.apache.org by Emmanuel Lecharny <el...@gmail.com> on 2006/12/07 17:34:29 UTC

Binary attributes

Hi,

while I'm writting some SyntaxCheckers, a question popped in my mind : do we
still have to take care of binary attributes ? This is a list of attributes
type which is set into server.xml to express the fact that those attributes
are considered as binary, and not as text, thus their values are stored as
byte[] insteado of UTF-8 Strings.

Each attribute has a type, and must respect a Syntax, which already describe
the type of data that can be stored into an attribute values. Be it
DirectoryString for instance, then the attribute value is an UTF-8 String,
as stated by RFC 4517. If we neeed to store a binary value like a jpeg file,
we can use the Jpeg syntax for the Attribute type. Otherwise, the
OctetString Syntax is able to handle any kind of value, for 0 byte to
whatever.

I guess we can relax a little bit the decoder checks by considering that all
attribute values are byte[], and let the Schema Interceptor deal with badly
written values, checking them with their associated Syntax.

wdyt ?

-- 
Cordialement,
Emmanuel Lécharny

Re: Binary attributes

Posted by Emmanuel Lecharny <el...@gmail.com>.
Funnilly, pam just felt into the binary trap trying to search for a Jpeg
photo from the server, and get some badly decoded binary for this image,
just because it was not seen as binary thus stored as a UTF-8 String into
the server, instead of storing it as byte[].

Obviously we must fix that by correctly handling binary attributes into the
Schema interceptor, and not in the codec :)

Oh, it's supposed to work if we fix the server.xml file, btw...

On 12/8/06, Emmanuel Lecharny <el...@gmail.com> wrote:
>
>
> On 12/8/06, Alex Karasulu <ak...@apache.org> wrote:
> >
> > Emmanuel Lecharny wrote:
> > >      > I guess we can relax a little bit the decoder checks by
> > >     considering that
> > >      > all attribute values are byte[], and let the Schema Interceptor
> > deal
> > >      > with badly written values, checking them with their associated
> > >     Syntax.
> > >      >
> > >      > wdyt ?
> > >
> > >
> > >     IMO it is not required to check for syntax if the attribute is
> > binary.
> > >
> > >
> > > not true. Jpeg is binary, but it has a special syntax...
> >
> > Yeah but if it's binary we just treat it as a blob.
>
>
> The point is that we _know_ it's binary because we know it's attribute
> Type, so we don't need to
> keep a set of binary attributes.
>
> Why should we go
> > above and beyond a database to make sure we validate blobs?
>
> We won't validate blobs.
>
> Alex
> >
> >
> >
> >
>
>
> --
> Cordialement,
> Emmanuel Lécharny




-- 
Cordialement,
Emmanuel Lécharny

Re: Binary attributes

Posted by Emmanuel Lecharny <el...@gmail.com>.
On 12/8/06, Alex Karasulu <ak...@apache.org> wrote:
>
> Emmanuel Lecharny wrote:
> >      > I guess we can relax a little bit the decoder checks by
> >     considering that
> >      > all attribute values are byte[], and let the Schema Interceptor
> deal
> >      > with badly written values, checking them with their associated
> >     Syntax.
> >      >
> >      > wdyt ?
> >
> >
> >     IMO it is not required to check for syntax if the attribute is
> binary.
> >
> >
> > not true. Jpeg is binary, but it has a special syntax...
>
> Yeah but if it's binary we just treat it as a blob.


The point is that we _know_ it's binary because we know it's attribute Type,
so we don't need to
keep a set of binary attributes.

Why should we go
> above and beyond a database to make sure we validate blobs?

We won't validate blobs.

Alex
>
>
>
>


-- 
Cordialement,
Emmanuel Lécharny

Re: Binary attributes

Posted by Alex Karasulu <ak...@apache.org>.
Emmanuel Lecharny wrote:
>      > I guess we can relax a little bit the decoder checks by
>     considering that
>      > all attribute values are byte[], and let the Schema Interceptor deal
>      > with badly written values, checking them with their associated
>     Syntax.
>      >
>      > wdyt ?
> 
> 
>     IMO it is not required to check for syntax if the attribute is binary.
> 
> 
> not true. Jpeg is binary, but it has a special syntax...

Yeah but if it's binary we just treat it as a blob.  Why should we go 
above and beyond a database to make sure we validate blobs?

Alex


Re: Binary attributes

Posted by Emmanuel Lecharny <el...@gmail.com>.
>
> > I guess we can relax a little bit the decoder checks by considering that
> > all attribute values are byte[], and let the Schema Interceptor deal
> > with badly written values, checking them with their associated Syntax.
> >
> > wdyt ?
>
>
> IMO it is not required to check for syntax if the attribute is binary.


not true. Jpeg is binary, but it has a special syntax...

Alex
>
>
>


-- 
Cordialement,
Emmanuel Lécharny

Re: Binary attributes

Posted by Alex Karasulu <ak...@apache.org>.
Emmanuel Lecharny wrote:
> Hi,
> 
> while I'm writting some SyntaxCheckers, a question popped in my mind : 
> do we still have to take care of binary attributes ? This is a list of 
> attributes type which is set into server.xml to express the fact that 
> those attributes are considered as binary, and not as text, thus their 
> values are stored as byte[] insteado of UTF-8 Strings.

Those guys use a NoOpSyntax check that accepts everything. I think we 
have one of those.  It's an AcceptAllSyntaxChecker or something like that.

If we had all syntax checkers in one place this would make it easier to 
find out what SC we had.

...

> I guess we can relax a little bit the decoder checks by considering that 
> all attribute values are byte[], and let the Schema Interceptor deal 
> with badly written values, checking them with their associated Syntax.
> 
> wdyt ?


IMO it is not required to check for syntax if the attribute is binary.

Alex