/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software <http://www.openldap.org/>.
*
- * Copyright 1999-2004 The OpenLDAP Foundation.
+ * Copyright 1999-2005 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#define UNSUPPORTED_EXOP "unsupported extended operation"
-#ifdef LDAP_DEVEL
-#define SLAP_EXOP_HIDE 0x0000
-#else
-#define SLAP_EXOP_HIDE 0x8000
-#endif
static struct extop_list {
struct extop_list *next;
} builtin_extops[] = {
{ &slap_EXOP_CANCEL, SLAP_EXOP_HIDE, cancel_extop },
{ &slap_EXOP_WHOAMI, 0, whoami_extop },
- { &slap_EXOP_MODIFY_PASSWD, 0, passwd_extop },
+ { &slap_EXOP_MODIFY_PASSWD, SLAP_EXOP_WRITES, passwd_extop },
#ifdef HAVE_TLS
{ &slap_EXOP_START_TLS, 0, starttls_extop },
#endif
}
/* check for controls inappropriate for all extended operations */
- if( get_manageDSAit( op ) == SLAP_CRITICAL_CONTROL ) {
+ if( get_manageDSAit( op ) == SLAP_CONTROL_CRITICAL ) {
send_ldap_error( op, rs,
LDAP_UNAVAILABLE_CRITICAL_EXTENSION,
"manageDSAit control inappropriate" );
goto done;
}
+ op->ore_flags = ext->flags;
+
Debug( LDAP_DEBUG_ARGS, "do_extended: oid=%s\n",
op->ore_reqoid.bv_val, 0 ,0 );
if( rs->sr_err != SLAPD_ABANDON ) {
if ( rs->sr_err == LDAP_REFERRAL && rs->sr_ref == NULL ) {
- rs->sr_ref = referral_rewrite( SLAPD_GLOBAL(default_referral),
+ rs->sr_ref = referral_rewrite( default_referral,
NULL, NULL, LDAP_SCOPE_DEFAULT );
- if ( !rs->sr_ref ) rs->sr_ref = SLAPD_GLOBAL(default_referral);
+ if ( !rs->sr_ref ) rs->sr_ref = default_referral;
if ( !rs->sr_ref ) {
rs->sr_err = LDAP_UNWILLING_TO_PERFORM;
rs->sr_text = "referral missing";
send_ldap_extended( op, rs );
- if ( rs->sr_ref != SLAPD_GLOBAL(default_referral) ) {
+ if ( rs->sr_ref != default_referral ) {
ber_bvarray_free( rs->sr_ref );
rs->sr_ref = NULL;
}
bv = (struct berval *) ch_malloc( sizeof(struct berval) );
if( op->o_dn.bv_len ) {
- bv->bv_len = op->o_dn.bv_len + sizeof("dn:")-1;
+ bv->bv_len = op->o_dn.bv_len + STRLENOF( "dn:" );
bv->bv_val = ch_malloc( bv->bv_len + 1 );
- AC_MEMCPY( bv->bv_val, "dn:", sizeof("dn:")-1 );
- AC_MEMCPY( &bv->bv_val[sizeof("dn:")-1], op->o_dn.bv_val,
+ AC_MEMCPY( bv->bv_val, "dn:", STRLENOF( "dn:" ) );
+ AC_MEMCPY( &bv->bv_val[STRLENOF( "dn:" )], op->o_dn.bv_val,
op->o_dn.bv_len );
bv->bv_val[bv->bv_len] = '\0';