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

Re: no whitespace compression in dn (ITS#852)



Fixed in both HEAD and OPENLDAP_REL_ENG_2.  Please test.

At 05:46 PM 10/20/00 +0000, david.cooper@nist.gov wrote:
>Full_Name: David Cooper
>Version: 2.0.6
>OS: Red Hat Linux 6.2
>URL: ftp://ftp.openldap.org/incoming/
>Submission from: (NULL) (129.6.54.72)
>
>
>The normalization process for DNs does not compress whitespace within attribute
>values nor does it eliminate whitespace at the end of the DN. For example, if a
>DN of the form
>
>dn: cn=User1, ou=NIST, o=U.S.   Government, c=US
> 
>is entered into the database, a search with a base of "o=U.S. Government, c=US
>"
>will not find the entry.
>
>I was able to correct these problems by adding a few lines of code to the
>dn_validate function in openldap-2.0.6/servers/slapd/dn.c.
>
>First, under the section "case INVALUE:", I replaced
>
>} else {
>        *d++ = *s;
>}
>
>with
>
>} else if ( ASCII_SPACE( *s ) ) {
>        if ( !ASCII_SPACE( *(d - 1) ) ) {
>        *d++ = ' ';
>        }
>} else {
>        *d++ = *s;
>}
>
>second, after the for loop, but before the line "*d = '\0';", I added the
>following lines:
>
>if (state != B4LEADTYPE) {
>        while ( ASCII_SPACE( *(d - 1) ) )
>                d--;
>}
>
>These changes seem to have fixed the problem, however, given that I am not very
>familiar with the code, I can not be sure that this was the best way to fix the
>problem or that it solves the problem entirely.
>
>Dave