int rc;
struct berval path, pdn, pndn;
- dnParent(&op->o_req_dn, &pdn);
- dnParent(&op->o_req_ndn, &pndn);
+ dnParent( &op->o_req_dn, &pdn );
+ dnParent( &op->o_req_ndn, &pndn );
dn2path( op->o_bd, &op->o_req_ndn, &path );
rc = ldif_read_entry( op, path.bv_val, &pdn, &pndn, entryp, text );
if ( rc == LDAP_SUCCESS && pathp != NULL ) {
*pathp = path;
} else {
- SLAP_FREE(path.bv_val);
+ SLAP_FREE( path.bv_val );
}
return rc;
}
return rc;
}
-static int apply_modify_to_entry(Entry * entry,
- Modifications * modlist,
- Operation * op,
- SlapReply * rs)
+static int
+apply_modify_to_entry(
+ Entry *entry,
+ Modifications *modlist,
+ Operation *op,
+ SlapReply *rs )
{
char textbuf[SLAP_TEXT_BUFLEN];
int rc = modlist ? LDAP_UNWILLING_TO_PERFORM : LDAP_SUCCESS;
&rs->sr_text, textbuf,
sizeof( textbuf ) );
break;
-
+
case LDAP_MOD_DELETE:
rc = modify_delete_values(entry, mods,
get_permissiveModify(op),
&rs->sr_text, textbuf,
sizeof( textbuf ) );
break;
-
+
case LDAP_MOD_REPLACE:
rc = modify_replace_values(entry, mods,
get_permissiveModify(op),
}
/* let the front-end send success */
- return_val = 0;
- goto return_result;
+ return_val = LDAP_SUCCESS;
return_result:
ldap_pvt_thread_rdwr_runlock(&li->li_rdwr);
- if(return_val != 0)
+ if(return_val != LDAP_SUCCESS)
send_ldap_result( op, rs );
if(entry != NULL)
entry_free(entry);
return return_val;
}
-static int ldif_back_search(Operation *op, SlapReply *rs)
+static int
+ldif_back_search( Operation *op, SlapReply *rs )
{
struct ldif_info *li = (struct ldif_info *) op->o_bd->be_private;
return rs->sr_err;
}
-static int ldif_back_add(Operation *op, SlapReply *rs) {
+static int
+ldif_back_add( Operation *op, SlapReply *rs )
+{
struct ldif_info *li = (struct ldif_info *) op->o_bd->be_private;
Entry * e = op->ora_e;
struct berval path;
rs->sr_err = rc;
Debug( LDAP_DEBUG_TRACE, "ldif_back_add: err: %d text: %s\n",
rc, rs->sr_text ? rs->sr_text : "", 0 );
- send_ldap_result(op, rs);
+ send_ldap_result( op, rs );
slap_graduate_commit_csn( op );
return rs->sr_err;
}
-static int ldif_back_modify(Operation *op, SlapReply *rs) {
+static int
+ldif_back_modify( Operation *op, SlapReply *rs )
+{
struct ldif_info *li = (struct ldif_info *) op->o_bd->be_private;
Modifications * modlst = op->orm_modlist;
struct berval path;
"cannot delete", path.bv_val, STRERROR( errno ) );
}
- SLAP_FREE(path.bv_val);
+ SLAP_FREE( path.bv_val );
done:
ldap_pvt_thread_rdwr_wunlock( &li->li_rdwr );
ldap_pvt_thread_mutex_unlock( &li->li_modop_mutex );
}
static int
-ldif_back_modrdn(Operation *op, SlapReply *rs)
+ldif_back_modrdn( Operation *op, SlapReply *rs )
{
struct ldif_info *li = (struct ldif_info *) op->o_bd->be_private;
struct berval new_dn = BER_BVNULL, new_ndn = BER_BVNULL;
} else {
dnParent( &entry->e_name, &p_dn );
}
- build_new_dn( &new_dn, &p_dn, &op->oq_modrdn.rs_newrdn, NULL );
+ build_new_dn( &new_dn, &p_dn, &op->oq_modrdn.rs_newrdn, NULL );
dnNormalize( 0, NULL, NULL, &new_dn, &new_ndn, NULL );
same_ndn = !ber_bvcmp( &entry->e_nname, &new_ndn );
ber_memfree_x( entry->e_name.bv_val, NULL );
/* Slap tools */
-static int ldif_tool_entry_open(BackendDB *be, int mode) {
+static int
+ldif_tool_entry_open( BackendDB *be, int mode )
+{
struct ldif_tool *tl = &((struct ldif_info *) be->be_private)->li_tool;
tl->ecurrent = 0;
return 0;
-}
+}
-static int ldif_tool_entry_close(BackendDB * be) {
+static int
+ldif_tool_entry_close( BackendDB *be )
+{
struct ldif_tool *tl = &((struct ldif_info *) be->be_private)->li_tool;
Entry **entries = tl->entries;
ID i;
return 0;
}
-static ID ldif_tool_entry_next(BackendDB *be)
+static ID
+ldif_tool_entry_next( BackendDB *be )
{
struct ldif_tool *tl = &((struct ldif_info *) be->be_private)->li_tool;
}
static ID
-ldif_tool_entry_first(BackendDB *be)
+ldif_tool_entry_first( BackendDB *be )
{
struct ldif_tool *tl = &((struct ldif_info *) be->be_private)->li_tool;
return ldif_tool_entry_next( be );
}
-static Entry * ldif_tool_entry_get(BackendDB * be, ID id) {
+static Entry *
+ldif_tool_entry_get( BackendDB *be, ID id )
+{
struct ldif_tool *tl = &((struct ldif_info *) be->be_private)->li_tool;
Entry *e = NULL;
{
struct ldif_info *li = be->be_private;
- ch_free(li->li_base_path.bv_val);
+ ch_free( li->li_base_path.bv_val );
ldap_pvt_thread_rdwr_destroy( &li->li_rdwr );
ldap_pvt_thread_mutex_destroy( &li->li_modop_mutex );
free( be->be_private );
}
static int
-ldif_back_db_open( Backend *be, ConfigReply *cr)
+ldif_back_db_open( Backend *be, ConfigReply *cr )
{
struct ldif_info *li = (struct ldif_info *) be->be_private;
if( BER_BVISEMPTY(&li->li_base_path)) {/* missing base path */
}
int
-ldif_back_initialize(
- BackendInfo *bi
- )
+ldif_back_initialize( BackendInfo *bi )
{
static char *controls[] = {
LDAP_CONTROL_MANAGEDSAIT,
bi->bi_tool_entry_put = ldif_tool_entry_put;
bi->bi_tool_entry_reindex = 0;
bi->bi_tool_sync = 0;
-
+
bi->bi_tool_dn2id_get = 0;
bi->bi_tool_entry_modify = 0;