]> git.sur5r.net Git - openldap/blobdiff - servers/slapd/bconfig.c
ITS#7256 A few issues discovered during testing slapmodify.
[openldap] / servers / slapd / bconfig.c
index f9b5531e8bef57ff6b3792f99ac433c13121d580..ded66131b45b1d218114d15684c41e9da0495458 100644 (file)
@@ -2,7 +2,7 @@
 /* $OpenLDAP$ */
 /* This work is part of OpenLDAP Software <http://www.openldap.org/>.
  *
- * Copyright 2005-2013 The OpenLDAP Foundation.
+ * Copyright 2005-2014 The OpenLDAP Foundation.
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -3661,7 +3661,8 @@ loglevel2bvarray( int l, BerVarray *bva )
        }
 
        if ( l == 0 ) {
-               return value_add_one( bva, ber_bvstr( "0" ) );
+               struct berval bv = BER_BVC("0");
+               return value_add_one( bva, &bv );
        }
 
        return mask_to_verbs( loglevel_ops, l, bva );
@@ -6803,7 +6804,7 @@ config_build_schema_inc( ConfigArgs *c, CfEntryInfo *ceparent,
 
        for (; cf; cf=cf->c_sibs, c->depth++) {
                if ( !cf->c_at_head && !cf->c_cr_head && !cf->c_oc_head &&
-                       !cf->c_om_head && !cf->c_syn_head ) continue;
+                       !cf->c_om_head && !cf->c_syn_head && !cf->c_kids ) continue;
                c->value_dn.bv_val = c->log;
                LUTIL_SLASHPATH( cf->c_file.bv_val );
                bv.bv_val = strrchr(cf->c_file.bv_val, LDAP_DIRSEP[0]);
@@ -7384,6 +7385,18 @@ config_tool_entry_next( BackendDB *be )
                return NOID;
 }
 
+static ID
+config_tool_dn2id_get( Backend *be, struct berval *dn )
+{
+       CfBackInfo *cfb = be->be_private;
+       BackendInfo *bi = cfb->cb_db.bd_info;
+
+       if ( bi && bi->bi_tool_dn2id_get )
+               return bi->bi_tool_dn2id_get( &cfb->cb_db, dn );
+
+       return NOID;
+}
+
 static Entry *
 config_tool_entry_get( BackendDB *be, ID id )
 {
@@ -7566,6 +7579,22 @@ config_tool_entry_put( BackendDB *be, Entry *e, struct berval *text )
                return NOID;
 }
 
+static ID
+config_tool_entry_modify( BackendDB *be, Entry *e, struct berval *text )
+{
+       CfBackInfo *cfb = be->be_private;
+       BackendInfo *bi = cfb->cb_db.bd_info;
+       CfEntryInfo *ce, *last;
+       ConfigArgs ca = {0};
+
+       ce = config_find_base( cfb->cb_root, &e->e_nname, &last );
+
+       if ( ce && bi && bi->bi_tool_entry_modify )
+               return bi->bi_tool_entry_modify( &cfb->cb_db, e, text );
+
+       return NOID;
+}
+
 static struct {
        char *name;
        AttributeDescription **desc;
@@ -7661,8 +7690,10 @@ config_back_initialize( BackendInfo *bi )
        bi->bi_tool_entry_first = config_tool_entry_first;
        bi->bi_tool_entry_first_x = config_tool_entry_first_x;
        bi->bi_tool_entry_next = config_tool_entry_next;
+       bi->bi_tool_dn2id_get = config_tool_dn2id_get;
        bi->bi_tool_entry_get = config_tool_entry_get;
        bi->bi_tool_entry_put = config_tool_entry_put;
+       bi->bi_tool_entry_modify = config_tool_entry_modify;
 
        ca.argv = argv;
        argv[ 0 ] = "slapd";