return 0;
}
+const char *
+loglevel2str( int l )
+{
+ struct berval bv = BER_BVNULL;
+
+ loglevel2bv( l, &bv );
+
+ return bv.bv_val;
+}
+
+int
+loglevel2bv( int l, struct berval *bv )
+{
+ if ( loglevel_ops == NULL ) {
+ loglevel_init();
+ }
+
+ BER_BVZERO( bv );
+
+ return enum_to_verb( loglevel_ops, l, bv ) == -1;
+}
+
+int
+loglevel2bvarray( int l, BerVarray *bva )
+{
+ if ( loglevel_ops == NULL ) {
+ loglevel_init();
+ }
+
+ return mask_to_verbs( loglevel_ops, l, bva );
+}
+
static int config_syslog;
static int
/* Get default or commandline slapd setting */
if ( ldap_syslog && !config_syslog )
config_syslog = ldap_syslog;
- return mask_to_verbs( loglevel_ops, config_syslog, &c->rvalue_vals );
+ return loglevel2bvarray( config_syslog, &c->rvalue_vals );
+
} else if ( c->op == LDAP_MOD_DELETE ) {
if ( !c->line ) {
config_syslog = 0;
setup_cookie sc;
slap_callback cb = { NULL, config_ldif_resp, NULL, NULL };
Connection conn = {0};
- char opbuf[OPERATION_BUFFER_SIZE];
+ OperationBuffer opbuf;
Operation *op;
SlapReply rs = {REP_RESULT};
Filter filter = { LDAP_FILTER_PRESENT };
if ( readit ) {
void *thrctx = ldap_pvt_thread_pool_context();
- op = (Operation *)opbuf;
+ op = (Operation *) &opbuf;
connection_fake_init( &conn, op, thrctx );
filter.f_desc = slap_schema.si_ad_objectClass;
BackendDB *be = op->o_bd;
slap_callback sc = { NULL, slap_null_cb, NULL, NULL };
op->o_bd = &cfb->cb_db;
+ /* FIXME: there must be a better way. */
+ if ( ber_bvcmp( &op->o_bd->be_rootndn, &be->be_rootndn )) {
+ op->o_bd->be_rootdn = be->be_rootdn;
+ op->o_bd->be_rootndn= be->be_rootndn;
+ }
sc.sc_next = op->o_callback;
op->o_callback = ≻
op->o_bd->be_add( op, rs );
BackendDB *be = op->o_bd;
slap_callback sc = { NULL, slap_null_cb, NULL, NULL };
op->o_bd = &cfb->cb_db;
+ if ( ber_bvcmp( &op->o_bd->be_rootndn, &be->be_rootndn )) {
+ op->o_bd->be_rootdn = be->be_rootdn;
+ op->o_bd->be_rootndn= be->be_rootndn;
+ }
sc.sc_next = op->o_callback;
op->o_callback = ≻
op->o_bd->be_modify( op, rs );
BackendInfo *bi;
ConfigArgs c;
Connection conn = {0};
- char opbuf[OPERATION_BUFFER_SIZE];
+ OperationBuffer opbuf;
Operation *op;
slap_callback cb = { NULL, slap_null_cb, NULL, NULL };
SlapReply rs = {REP_RESULT};
if ( cfb->cb_use_ldif ) {
thrctx = ldap_pvt_thread_pool_context();
- op = (Operation *)opbuf;
+ op = (Operation *) &opbuf;
connection_fake_init( &conn, op, thrctx );
op->o_dn = be->be_rootdn;