/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 2005-2006 The OpenLDAP Foundation.
+ * Copyright 2005-2007 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
fd = open( path->bv_val, O_RDONLY );
if ( fd < 0 ) {
- Debug( LDAP_DEBUG_ANY,
+ Debug( LDAP_DEBUG_TRACE,
"=> ldif_enum_tree: failed to open %s: %s\n",
path->bv_val, STRERROR(errno), 0 );
return LDAP_NO_SUCH_OBJECT;
entry->e_ocflags = 0;
}
/* check that the entry still obeys the schema */
- rc = entry_schema_check( op, entry, NULL, 0,
+ rc = entry_schema_check( op, entry, NULL, 0, 0,
&rs->sr_text, textbuf, sizeof( textbuf ) );
}
Debug( LDAP_DEBUG_TRACE, "ldif_back_add: \"%s\"\n", dn.bv_val, 0, 0);
+ rs->sr_err = entry_schema_check(op, e, NULL, 0, 1,
+ &rs->sr_text, textbuf, sizeof( textbuf ) );
+ if ( rs->sr_err != LDAP_SUCCESS ) goto send_res;
+
rs->sr_err = slap_add_opattrs( op,
&rs->sr_text, textbuf, sizeof( textbuf ), 1 );
if ( rs->sr_err != LDAP_SUCCESS ) goto send_res;
- rs->sr_err = entry_schema_check(op, e, NULL, 0,
- &rs->sr_text, textbuf, sizeof( textbuf ) );
- if ( rs->sr_err != LDAP_SUCCESS ) goto send_res;
-
ldap_pvt_thread_rdwr_wlock(&ni->li_rdwr);
dn2path(&dn, &op->o_bd->be_nsuffix[0], &ni->li_base_path, &leaf_path);
if(res != -1) {
/* if this fails we should log something bad */
res = unlink(path.bv_val);
+ path.bv_val[path.bv_len - STRLENOF(".ldif")] = '\0';
+ newpath.bv_val[newpath.bv_len - STRLENOF(".ldif")] = '\0';
+ res = rename(path.bv_val, newpath.bv_val);
res = LDAP_SUCCESS;
}
else {
return ( *ent == NULL ? 1 : 0 );
}
-static int ldif_tool_entry_open(BackendDB * be, int mode) {
+static int ldif_tool_entry_open(BackendDB *be, int mode) {
struct ldif_info *ni = (struct ldif_info *) be->be_private;
ni->li_tool_current = 0;
return 0;
}
static int
-ldif_back_db_init( BackendDB *be )
+ldif_back_db_init( BackendDB *be, ConfigReply *cr )
{
struct ldif_info *ni;
}
static int
-ldif_back_db_destroy(
- Backend *be
- )
+ldif_back_db_destroy( Backend *be, ConfigReply *cr )
{
struct ldif_info *ni = be->be_private;
}
static int
-ldif_back_db_open(
- Backend *be
- )
+ldif_back_db_open( Backend *be, ConfigReply *cr)
{
struct ldif_info *ni = (struct ldif_info *) be->be_private;
if( BER_BVISEMPTY(&ni->li_base_path)) {/* missing base path */