]> git.sur5r.net Git - openldap/commitdiff
fix attribute description parsing (ITS#5402)
authorPierangelo Masarati <ando@openldap.org>
Thu, 6 Mar 2008 23:30:54 +0000 (23:30 +0000)
committerPierangelo Masarati <ando@openldap.org>
Thu, 6 Mar 2008 23:30:54 +0000 (23:30 +0000)
servers/slapd/sets.c

index 7f3f8ceba89eb216a6cc3909fde204d2ad0fb8a8..d7c56fa9ed4b41f2726b389f8ef3cb853f4949a2 100644 (file)
@@ -709,20 +709,19 @@ slap_set_filter( SLAP_SET_GATHER gatherer,
                        break;
 
                default:
-                       if ( ( c != '_' )
-                                       && ( c < 'A' || c > 'Z' )
-                                       && ( c < 'a' || c > 'z' ) )
-                       {
+                       if ( !AD_LEADCHAR( c ) ) {
                                SF_ERROR( syntax );
                        }
                        filter--;
                        for ( len = 1;
-                                       ( c = filter[ len ] )
-                                               && ( ( c >= '0' && c <= '9' )
-                                                       || ( c >= 'A' && c <= 'Z' )
-                                                       || ( c >= 'a' && c <= 'z' ) );
-                                       len++ )
-                               /* count */ ;
+                               ( c = filter[ len ] ) && AD_CHAR( c );
+                               len++ )
+                       {
+                               /* count */
+                               if ( c == '-' && !AD_CHAR( filter[ len + 1 ] ) ) {
+                                       break;
+                               }
+                       }
                        if ( len == 4
                                && memcmp( "this", filter, len ) == 0 )
                        {