]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/aci.c
Plug leaks
[openldap] / servers / slapd / aci.c
index 97276cfc0b625b26c83aa1e33c093b1ada4a2482..a86e3acd1fe1380a4bf31a9284b0c94bd3869eac 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 1998-2006 The OpenLDAP Foundation.
+ * Copyright 1998-2007 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -278,18 +278,31 @@ aci_list_get_attr_rights(
        ACL_INIT(mask);
        for ( i = 1; acl_get_part( list, i + 1, ';', &bv ) >= 0; i += 2 ) {
                if ( aci_list_has_attr( &bv, attr, val ) == 0 ) {
-                       Debug( LDAP_DEBUG_ACL, "        <= aci_list_get_attr_rights test %s for %s -> failed\n", bv.bv_val, attr->bv_val, 0 );
+                       Debug( LDAP_DEBUG_ACL,
+                               "        <= aci_list_get_attr_rights "
+                               "test %s for %s -> failed\n",
+                               bv.bv_val, attr->bv_val, 0 );
                        continue;
                }
-               Debug( LDAP_DEBUG_ACL, "        <= aci_list_get_attr_rights test %s for %s -> ok\n", bv.bv_val, attr->bv_val, 0 );
+
+               Debug( LDAP_DEBUG_ACL,
+                       "        <= aci_list_get_attr_rights "
+                       "test %s for %s -> ok\n",
+                       bv.bv_val, attr->bv_val, 0 );
 
                if ( acl_get_part( list, i, ';', &bv ) < 0 ) {
-                       Debug( LDAP_DEBUG_ACL, "        <= aci_list_get_attr_rights test no rightsk\n", 0, 0, 0 );
+                       Debug( LDAP_DEBUG_ACL,
+                               "        <= aci_list_get_attr_rights "
+                               "test no rights\n",
+                               0, 0, 0 );
                        continue;
                }
 
                mask |= aci_list_map_rights( &bv );
-               Debug( LDAP_DEBUG_ACL, "        <= aci_list_get_attr_rights rights %s to mask 0x%x\n", bv.bv_val, mask, 0 );
+               Debug( LDAP_DEBUG_ACL,
+                       "        <= aci_list_get_attr_rights "
+                       "rights %s to mask 0x%x\n",
+                       bv.bv_val, mask, 0 );
        }
 
        return mask;
@@ -449,7 +462,7 @@ aci_mask(
           This routine now supports scope={ENTRY,CHILDREN}
           with the semantics:
             - ENTRY applies to "entry" and "subtree";
-            - CHILDREN aplies to "children" and "subtree"
+            - CHILDREN applies to "children" and "subtree"
         */
 
        /* check that the aci has all 5 components */
@@ -1016,7 +1029,7 @@ bv_get_tail(
  *    action    := perms;attrs[[;perms;attrs]...]
  *    perms     := perm[[,perm]...]
  *    perm      := c|s|r|w|x
- *    attrs     := attribute[[,attribute]..]|[all]
+ *    attrs     := attribute[[,attribute]..]|"[all]"
  *    attribute := attributeType|attributeType=attributeValue|attributeType=attributeValuePrefix*
  *    type      := public|users|self|dnattr|group|role|set|set-ref|
  *                 access_id|subtree|onelevel|children
@@ -1545,6 +1558,8 @@ OpenLDAPaciPrettyNormal(
                        freetype = 0;
        char            *ptr;
 
+       BER_BVZERO( out );
+
        if ( BER_BVISEMPTY( val ) ) {
                Debug( LDAP_DEBUG_ACL, "aciPrettyNormal: value is empty\n", 0, 0, 0 );
                return LDAP_INVALID_SYNTAX;