]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/operational.c
Change slap_sasl_authorized to take an Operation instead of a Connection,
[openldap] / servers / slapd / operational.c
index 603d82456c59a88cf7ffa213067a3c6e3b202153..d03d4f3e16dedb1a7d85e3378c6df41be6f783c0 100644 (file)
@@ -18,16 +18,21 @@ slap_operational_subschemaSubentry( Backend *be )
        Attribute       *a;
 
        /* The backend wants to take care of it */
-       if ( be && be->be_schemadn.bv_val )
-               return NULL;
+       if ( be && be->be_schemadn.bv_val ) return NULL;
 
        a = ch_malloc( sizeof( Attribute ) );
        a->a_desc = slap_schema.si_ad_subschemaSubentry;
 
        a->a_vals = ch_malloc( 2 * sizeof( struct berval ) );
        ber_dupbv( a->a_vals, &global_schemadn );
+       a->a_vals[1].bv_len = 0;
        a->a_vals[1].bv_val = NULL;
 
+       a->a_nvals = ch_malloc( 2 * sizeof( struct berval ) );
+       ber_dupbv( a->a_nvals, &global_schemandn );
+       a->a_nvals[1].bv_len = 0;
+       a->a_nvals[1].bv_val = NULL;
+
        a->a_next = NULL;
        a->a_flags = 0;
 
@@ -38,26 +43,24 @@ Attribute *
 slap_operational_hasSubordinate( int hs )
 {
        Attribute       *a;
-       char            *val;
-       ber_len_t       len;
+       struct berval   val;
 
        if ( hs ) {
-               val = "TRUE";
-               len = sizeof( "TRUE" ) - 1;
+               val = slap_true_bv;
 
        } else {
-               val = "FALSE";
-               len = sizeof( "FALSE" ) - 1;
-
+               val = slap_false_bv;
        }
 
        a = ch_malloc( sizeof( Attribute ) );
        a->a_desc = slap_schema.si_ad_hasSubordinates;
        a->a_vals = ch_malloc( 2 * sizeof( struct berval ) );
 
-       ber_str2bv( val, len, 1, a->a_vals );
+       ber_dupbv( &a->a_vals[0], &val );
        a->a_vals[1].bv_val = NULL;
 
+       a->a_nvals = a->a_vals;
+
        a->a_next = NULL;
        a->a_flags = 0;