Backend *be,
Connection *conn,
Operation *op,
- char *oid,
+ char *reqoid,
struct berval *reqdata,
+ char **rspoid,
struct berval **rspdata,
LDAPControl *** rspctrls,
- char** text
+ char** text,
+ struct berval *** refs
)
{
int i;
for( i=0; exop_table[i].oid != NULL; i++ ) {
- if( strcmp( exop_table[i].oid, oid ) == 0 ) {
+ if( strcmp( exop_table[i].oid, reqoid ) == 0 ) {
return (exop_table[i].extended)(
- be, conn, op, oid,
- reqdata, rspdata, rspctrls, text );
+ be, conn, op,
+ reqoid, reqdata,
+ rspoid, rspdata, rspctrls, text, refs );
}
}
Connection *conn, Operation *op,
char *reqoid,
struct berval *reqdata,
+ char **rspoid,
struct berval **rspdata,
LDAPControl *** rspctrls,
- char **text ));
+ char **text,
+ struct berval *** refs ));
extern int ldbm_back_bind LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
Backend *be,
Connection *conn,
Operation *op,
- char *oid,
+ char *reqoid,
struct berval *reqdata,
+ char **rspoid,
struct berval **rspdata,
LDAPControl *** rspctrls,
- char** text
+ char** text,
+ struct berval *** refs
)
{
struct ldbminfo *li = (struct ldbminfo *) be->be_private;
char *dn;
- assert( oid != NULL );
- assert( strcmp( LDAP_EXOP_X_MODIFY_PASSWD, oid ) == 0 );
+ assert( reqoid != NULL );
+ assert( strcmp( LDAP_EXOP_X_MODIFY_PASSWD, reqoid ) == 0 );
rc = slap_passwd_parse( reqdata,
&id, NULL, &new, text );
*/
extern int ldbm_back_exop_passwd LDAP_P(( BackendDB *bd,
Connection *conn, Operation *op,
- char *oid,
+ char *reqoid,
struct berval *reqdata,
+ char **rspoid,
struct berval **rspdata,
LDAPControl ***rspctrls,
- char **text ));
+ char **text,
+ struct berval *** refs ));
/*
)
{
int rc = LDAP_SUCCESS;
- char* oid;
+ char* reqoid;
struct berval *reqdata;
ber_tag_t tag;
ber_len_t len;
extop_list_t *ext;
char *text;
struct berval **refs;
+ char *rspoid;
struct berval *rspdata;
LDAPControl **rspctrls;
Debug( LDAP_DEBUG_TRACE, "do_extended\n", 0, 0, 0 );
- oid = NULL;
+ reqoid = NULL;
reqdata = NULL;
if( op->o_protocol < LDAP_VERSION3 ) {
goto done;
}
- if ( ber_scanf( op->o_ber, "{a" /*}*/, &oid ) == LBER_ERROR ) {
+ if ( ber_scanf( op->o_ber, "{a" /*}*/, &reqoid ) == LBER_ERROR ) {
Debug( LDAP_DEBUG_ANY, "do_extended: ber_scanf failed\n", 0, 0 ,0 );
send_ldap_disconnect( conn, op,
LDAP_PROTOCOL_ERROR, "decoding error" );
goto done;
}
- if( !(ext = find_extop(supp_ext_list, oid)) ) {
+ if( !(ext = find_extop(supp_ext_list, reqoid)) ) {
Debug( LDAP_DEBUG_ANY, "do_extended: unsupported operation \"%s\"\n",
- oid, 0 ,0 );
+ reqoid, 0 ,0 );
send_ldap_result( conn, op, rc = LDAP_PROTOCOL_ERROR,
NULL, "unsupported extended operation", NULL, NULL );
goto done;
return rc;
}
- Debug( LDAP_DEBUG_ARGS, "do_extended: oid=%s\n", oid, 0 ,0 );
+ Debug( LDAP_DEBUG_ARGS, "do_extended: oid=%s\n", reqoid, 0 ,0 );
+ rspoid = NULL;
rspdata = NULL;
rspctrls = NULL;
text = NULL;
+ refs = NULL;
rc = (ext->ext_main)( extop_callback, conn, op,
- oid, reqdata, &rspdata, &rspctrls, &text );
+ reqoid, reqdata,
+ &rspoid, &rspdata, &rspctrls, &text, &refs );
if( rc != SLAPD_ABANDON ) {
- refs = NULL;
- if (rc == LDAP_REFERRAL)
+ if (rc == LDAP_REFERRAL) {
refs = default_referral;
+ }
+
+ send_ldap_extended( conn, op, rc, NULL, text, refs,
+ rspoid, rspdata, rspctrls );
+ }
- send_ldap_extended( conn, op, rc, NULL, text,
- refs, oid, rspdata, rspctrls );
+ if ( rspoid != NULL ) {
+ free( rspoid );
}
if ( rspdata != NULL )
if ( reqdata != NULL ) {
ber_bvfree( reqdata );
}
- if ( oid != NULL ) {
- free( oid );
+ if ( reqoid != NULL ) {
+ free( reqoid );
}
return rc;
int passwd_extop(
SLAP_EXTOP_CALLBACK_FN ext_callback,
- Connection *conn, Operation *op, char *oid,
+ Connection *conn, Operation *op,
+ char *reqoid,
struct berval *reqdata,
+ char **rspoid,
struct berval **rspdata,
LDAPControl ***rspctrls,
- char **text )
+ char **text,
+ struct berval ***refs )
{
int rc;
- assert( oid != NULL );
- assert( strcmp( LDAP_EXOP_X_MODIFY_PASSWD, oid ) == 0 );
+ assert( reqoid != NULL );
+ assert( strcmp( LDAP_EXOP_X_MODIFY_PASSWD, reqoid ) == 0 );
if( op->o_dn == NULL || op->o_dn[0] == '\0' ) {
*text = ch_strdup("only authenicated users may change passwords");
return LDAP_STRONG_AUTH_REQUIRED;
}
- if( conn->c_authz_backend != NULL &&
- conn->c_authz_backend->be_extended )
+ if( conn->c_authz_backend != NULL && conn->c_authz_backend->be_extended )
{
- rc = conn->c_authz_backend->be_extended(
- conn->c_authz_backend,
- conn, op, oid, reqdata, rspdata, rspctrls, text );
+ if( global_readonly || conn->c_authz_backend->be_readonly ) {
+ *text = ch_strdup("authorization database is read only");
+ rc = LDAP_UNWILLING_TO_PERFORM;
+
+ } else if( conn->c_authz_backend->be_update_ndn != NULL ) {
+ /* we SHOULD return a referral in this case */
+ *refs = conn->c_authz_backend->be_update_refs;
+ rc = LDAP_REFERRAL;
+
+ } else {
+ rc = conn->c_authz_backend->be_extended(
+ conn->c_authz_backend, conn, op,
+ reqoid, reqdata,
+ rspoid, rspdata, rspctrls,
+ text, refs );
+ }
} else {
*text = ch_strdup("operation not supported for current user");
typedef int (*SLAP_EXTOP_MAIN_FN) LDAP_P((
SLAP_EXTOP_CALLBACK_FN,
Connection *conn, Operation *op,
- char * oid,
+ char * reqoid,
struct berval * reqdata,
+ char ** rspoid,
struct berval ** rspdata,
LDAPControl *** rspctrls,
- char ** text ));
+ char ** text,
+ struct berval *** refs ));
typedef int (*SLAP_EXTOP_GETOID_FN) LDAP_P((
int index, char *oid, int blen ));
Connection *conn, Operation *op,
ber_int_t err, const char *matched,
const char *text,
+ struct berval **refs,
LDAPControl **ctrls,
struct berval *cred ));
char *rspoid, struct berval *rspdata,
LDAPControl **ctrls ));
+LIBSLAPD_F (void) send_ldap_partial LDAP_P((
+ Connection *conn, Operation *op,
+ char *rspoid, struct berval *rspdata,
+ LDAPControl **ctrls ));
+
LIBSLAPD_F (void) send_search_result LDAP_P((
Connection *conn, Operation *op,
ber_int_t err, const char *matched, const char *text,
LIBSLAPD_F (int) starttls_extop LDAP_P((
SLAP_EXTOP_CALLBACK_FN,
Connection *conn, Operation *op,
- char * oid,
+ char * reqoid,
struct berval * reqdata,
+ char ** rspoid,
struct berval ** rspdata,
LDAPControl ***rspctrls,
- char ** text ));
+ char ** text,
+ struct berval *** refs ));
/*
LIBSLAPD_F (int) passwd_extop LDAP_P((
SLAP_EXTOP_CALLBACK_FN,
Connection *conn, Operation *op,
- char * oid,
+ char * reqoid,
struct berval * reqdata,
+ char ** rspoid,
struct berval ** rspdata,
LDAPControl *** rspctrls,
- char ** text ));
+ char ** text,
+ struct berval *** refs ));
LIBSLAPD_F (int) slap_passwd_check(
Attribute *attr,
ber_int_t err,
const char *matched,
const char *text,
+ struct berval **ref,
LDAPControl **ctrls,
struct berval *cred
)
#endif
send_ldap_response( conn, op, tag, msgid,
- err, matched, text, NULL,
+ err, matched, text, ref,
NULL, NULL, cred, ctrls );
}
Backend *be,
struct slap_conn *conn,
struct slap_op *op,
- char *oid,
+ char *reqoid,
struct berval * reqdata,
+ char **rspoid,
struct berval ** rspdata,
- LDAPControl ***rspctrls,
- char** text ));
+ LDAPControl *** rspctrls,
+ char ** text,
+ struct berval *** refs ));
struct slap_backend_info {
char *bi_type; /* type of backend */
SLAP_EXTOP_CALLBACK_FN cb,
Connection *conn,
Operation *op,
- char * oid,
+ char * reqoid,
struct berval * reqdata,
+ char ** rspoid,
struct berval ** rspdata,
LDAPControl ***rspctrls,
- char ** text )
+ char ** text,
+ struct berval *** refs )
{
void *ctx;
ber_int_t err,
const char *matched,
const char *text,
+ struct berval **refs,
LDAPControl **ctrls,
struct berval *cred
)