[Date Prev][Date Next] [Chronological] [Thread] [Top]

Re: Searching on attributes with spaces (fwd)



- Saw this on the Perl-ldap list, it claims that 
openldap allows attribute names with spaces in them
in violation of RFC2251.  

- Booker C. Bense 

---------- Forwarded message ----------
Date: Thu, 23 Sep 1999 21:18:23 -0500
From: Mark Wilcox <mewilcox@unt.edu>
To: Graham Barr <gbarr@pobox.com>
Cc: perl-ldap@mail.med.cornell.edu
Subject: Re: Searching on attributes with spaces
Resent-Date: Thu, 23 Sep 1999 22:22:09 -0400 (EDT)
Resent-From: perl-ldap@mail.med.cornell.edu

I say leave it alone. If someone is stupid enough to violate the specs, they
should have to fix it, it's not the API's fault they violated the spec.

The PerLDAP team ran into the same problem. They had hash keys that started with
a _ because you can't have an attribute that starts with a "_" but someone did.
That person learned the error of their ways :)


Mark

Graham Barr wrote:

> According to RFC2251 section 4.1.4/4.1.5
>
>    A specification may also assign one or more textual names for an
>    attribute type.  These names MUST begin with a letter, and only
>    contain ASCII letters, digit characters and hyphens.  They are case
>    insensitive.  (These ASCII characters are identical to ISO 10646
>    characters whose UTF-8 encoding is a single byte between 0x00 and
>    0x7F.)
>
> This states that a space is not a legal charater in an attribute name,
> which is why Net::LDAP::Filter does not allow them. To change this
> (although I am not sure we should) Look in Filter,pm for the
> line
>
> my($Attr)  = qw{  [-;.:\d\w]*[-;\d\w] };
>
> and change it too
>
> my($Attr)  = qw{  [-;.:\d\s\w]*[-;\d\w] };
>
> On Thu, Sep 23, 1999 at 06:10:49PM -0700, Scott Kelley wrote:
> > I've got a few attributes that have spaces in them (ex. "home phone"). When
> > I try and search on these attributes nothing is returned. I've tried to
> > escape the spaces in the attributes, quoting the entire filter, but nothing
> > seems to remedy the situation. If I pass the same filter to OpenLDAP's
> > ldapsearch utility it works fine. Any thoughts?
> >
> > Here's an example filter:
> >
> > (home phone=*633*)
> >
> > Thanks for your help.
>
> --
> For myself I am an optimist--it does not seem to be much use being
> anything else. -- Winston Churchill