]> git.sur5r.net Git - openldap/blob - servers/slapd/back-bdb/extended.c
Fix cache consistency problems on txn retry
[openldap] / servers / slapd / back-bdb / extended.c
1 /* extended.c - bdb backend extended routines */
2 /* $OpenLDAP$ */
3 /*
4  * Copyright 1998-2003 The OpenLDAP Foundation, All Rights Reserved.
5  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
6  */
7
8 #include "portable.h"
9
10 #include <stdio.h>
11 #include <ac/string.h>
12
13 #include "back-bdb.h"
14 #include "external.h"
15 #include "lber_pvt.h"
16
17 static struct exop {
18         struct berval *oid;
19         BI_op_extended  *extended;
20 } exop_table[] = {
21         { (struct berval *)&slap_EXOP_MODIFY_PASSWD, bdb_exop_passwd },
22         { NULL, NULL }
23 };
24
25 int
26 bdb_extended(
27         Backend         *be,
28         Connection              *conn,
29         Operation               *op,
30         struct berval           *reqoid,
31         struct berval   *reqdata,
32         char            **rspoid,
33         struct berval   **rspdata,
34         LDAPControl *** rspctrls,
35         const char**    text,
36         BerVarray       *refs 
37 )
38 {
39         int i;
40
41         for( i=0; exop_table[i].extended != NULL; i++ ) {
42                 if( ber_bvcmp( exop_table[i].oid, reqoid ) == 0 ) {
43                         return (exop_table[i].extended)(
44                                 be, conn, op,
45                                 reqoid, reqdata,
46                                 rspoid, rspdata, rspctrls,
47                                 text, refs );
48                 }
49         }
50
51         *text = "not supported within naming context";
52         return LDAP_UNWILLING_TO_PERFORM;
53 }
54