From 6fc8c3ff4e6c35cb8b0135a3b2dfb555b307b84c Mon Sep 17 00:00:00 2001 From: Kurt Zeilenga Date: Fri, 4 Jan 2002 00:45:05 +0000 Subject: [PATCH] Fix attribute description checks --- libraries/libldap/filter.c | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/libraries/libldap/filter.c b/libraries/libldap/filter.c index 6e46dfbe05..1cf8258228 100644 --- a/libraries/libldap/filter.c +++ b/libraries/libldap/filter.c @@ -117,7 +117,7 @@ static int ldap_is_desc ( const char *str ) return 0; options: - if( !LDAP_LDH( str[i] )) { + if( !LDAP_LDH( str[0] )) { return 0; } for( i=1; str[i]; i++ ) { @@ -508,19 +508,16 @@ put_simple_filter( case '<': ftype = LDAP_FILTER_LE; *s = '\0'; - if(! ldap_is_desc( str ) ) goto done; break; case '>': ftype = LDAP_FILTER_GE; *s = '\0'; - if(! ldap_is_desc( str ) ) goto done; break; case '~': ftype = LDAP_FILTER_APPROX; *s = '\0'; - if(! ldap_is_desc( str ) ) goto done; break; case ':': @@ -535,11 +532,7 @@ put_simple_filter( char *dn = strchr( str, ':' ); char *rule = NULL; - if( dn == NULL ) { - if(! ldap_is_desc( str ) ) goto done; - - } else { - + if( dn != NULL ) { *dn++ = '\0'; rule = strchr( dn, ':' ); @@ -627,6 +620,8 @@ put_simple_filter( } break; } + if( !ldap_is_desc( str ) ) goto done; + if ( ftype == LDAP_FILTER_PRESENT ) { rc = ber_printf( ber, "ts", ftype, str ); -- 2.39.5