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

index c337b8fe78ee8e21c61085933a4dbdda32b2362a..52222188de4c20434bf3d241977956ba65b71180 100644 (file)
@@ -506,16 +506,19 @@ acl_get(
                                                continue;
 
                                } else if ( a->acl_dn_style == ACL_STYLE_ONE ) {
-                                       int rdnlen = -1;
+                                       int     rdnlen = -1, sep = 0;
 
                                        if ( dnlen <= patlen )
                                                continue;
 
-                                       if ( !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 - 1 )
+                                       if ( rdnlen != dnlen - patlen - sep )
                                                continue;
 
                                } else if ( a->acl_dn_style == ACL_STYLE_SUBTREE ) {