- }
-#else
- f->f_sub_type = ch_strdup( str );
-#endif
- if ( str2subvals( value, f ) != 0 ) {
- filter_free( f );
+
+ } else if ( *nextstar == '\0' ) {
+ f->f_choice = LDAP_FILTER_EQUALITY;
+
+ } else if ( strcmp( value, "*" ) == 0 ) {
+ f->f_choice = LDAP_FILTER_PRESENT;
+
+ } else {
+ f->f_choice = LDAP_FILTER_SUBSTRINGS;
+ f->f_sub = ch_calloc( 1, sizeof( SubstringsAssertion ) );
+
+ rc = slap_str2ad( str, &f->f_sub_desc, &text );
+ if( rc != LDAP_SUCCESS ) {
+ filter_free( f );
+ *(value-1) = '=';
+ return NULL;
+ }
+
+ if ( str2subvals( value, f ) != 0 ) {
+ filter_free( f );
+ *(value-1) = '=';
+ return NULL;
+ }