]> git.sur5r.net Git - openldap/blob - servers/slapd/back-bdb/extended.c
ITS#2467 NULL pointer check
[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( Operation *op, SlapReply *rs )
27 /*      struct berval           *reqoid,
28         struct berval   *reqdata,
29         char            **rspoid,
30         struct berval   **rspdata,
31         LDAPControl *** rspctrls,
32         const char**    text,
33         BerVarray       *refs 
34 ) */
35 {
36         int i;
37
38         for( i=0; exop_table[i].extended != NULL; i++ ) {
39                 if( ber_bvcmp( exop_table[i].oid, &op->oq_extended.rs_reqoid ) == 0 ) {
40                         return (exop_table[i].extended)( op, rs );
41                 }
42         }
43
44         rs->sr_text = "not supported within naming context";
45         return LDAP_UNWILLING_TO_PERFORM;
46 }
47