]> git.sur5r.net Git - openldap/commitdiff
improve dn.one="" fix
authorPierangelo Masarati <ando@openldap.org>
Tue, 20 Apr 2004 14:50:16 +0000 (14:50 +0000)
committerPierangelo Masarati <ando@openldap.org>
Tue, 20 Apr 2004 14:50:16 +0000 (14:50 +0000)
servers/slapd/acl.c

index a9db8c393bf2c93d035b999bae00c87ff0155e4b..fcb2ffb4375855ac4de3bdbe3b8519846c7cb7cc 100644 (file)
@@ -541,17 +541,19 @@ acl_get(
                                                continue;
 
                                } else if ( a->acl_dn_style == ACL_STYLE_ONE ) {
-                                       int     rdnlen = -1,
-                                               off = patlen > 0 ? 1 : 0;
+                                       int     rdnlen = -1, sep = 0;
 
                                        if ( dnlen <= patlen )
                                                continue;
 
-                                       if ( patlen > 0 && !DN_SEPARATOR( e->e_ndn[dnlen - patlen - 1] ) )
-                                               continue;
+                                       if ( patlen > 0 ) {
+                                               if ( !DN_SEPARATOR( e->e_ndn[dnlen - patlen - 1] ) )
+                                                       continue;
+                                               sep = 1;
+                                       }
 
                                        rdnlen = dn_rdnlen( NULL, &e->e_nname );
-                                       if ( rdnlen != dnlen - patlen - off )
+                                       if ( rdnlen != dnlen - patlen - sep )
                                                continue;
 
                                } else if ( a->acl_dn_style == ACL_STYLE_SUBTREE ) {