Add SLAP_EXOP_WRITES flag, expose flags in Operation,

add exop_is_write() macro for detecting exops that modify a target entry
This commit is contained in:
Howard Chu 2004-11-19 22:19:13 +00:00
parent c7a8625da7
commit c8f49d0337
3 changed files with 15 additions and 6 deletions

View File

@ -45,11 +45,6 @@
#define UNSUPPORTED_EXOP "unsupported extended operation" #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 { static struct extop_list {
struct extop_list *next; struct extop_list *next;
@ -77,7 +72,7 @@ static struct {
} builtin_extops[] = { } builtin_extops[] = {
{ &slap_EXOP_CANCEL, SLAP_EXOP_HIDE, cancel_extop }, { &slap_EXOP_CANCEL, SLAP_EXOP_HIDE, cancel_extop },
{ &slap_EXOP_WHOAMI, 0, whoami_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 #ifdef HAVE_TLS
{ &slap_EXOP_START_TLS, 0, starttls_extop }, { &slap_EXOP_START_TLS, 0, starttls_extop },
#endif #endif
@ -225,6 +220,8 @@ fe_extended( Operation *op, SlapReply *rs )
goto done; goto done;
} }
op->ore_flags = ext->flags;
Debug( LDAP_DEBUG_ARGS, "do_extended: oid=%s\n", Debug( LDAP_DEBUG_ARGS, "do_extended: oid=%s\n",
op->ore_reqoid.bv_val, 0 ,0 ); op->ore_reqoid.bv_val, 0 ,0 );

View File

@ -616,6 +616,8 @@ LDAP_SLAPD_F (Entry *) entry_dup LDAP_P(( Entry *e ));
*/ */
LDAP_SLAPD_F (int) exop_root_dse_info LDAP_P ((Entry *e)); LDAP_SLAPD_F (int) exop_root_dse_info LDAP_P ((Entry *e));
#define exop_is_write( op ) ((op->ore_flags & SLAP_EXOP_WRITES) != 0)
LDAP_SLAPD_V( const struct berval ) slap_EXOP_CANCEL; LDAP_SLAPD_V( const struct berval ) slap_EXOP_CANCEL;
LDAP_SLAPD_V( const struct berval ) slap_EXOP_WHOAMI; LDAP_SLAPD_V( const struct berval ) slap_EXOP_WHOAMI;
LDAP_SLAPD_V( const struct berval ) slap_EXOP_MODIFY_PASSWD; LDAP_SLAPD_V( const struct berval ) slap_EXOP_MODIFY_PASSWD;

View File

@ -1696,13 +1696,22 @@ typedef struct req_abandon_s {
ber_int_t rs_msgid; ber_int_t rs_msgid;
} req_abandon_s; } req_abandon_s;
#ifdef LDAP_DEVEL
#define SLAP_EXOP_HIDE 0x0000
#else
#define SLAP_EXOP_HIDE 0x8000
#endif
#define SLAP_EXOP_WRITES 0x0001 /* Exop does writes */
typedef struct req_extended_s { typedef struct req_extended_s {
struct berval rs_reqoid; struct berval rs_reqoid;
int rs_flags;
struct berval *rs_reqdata; struct berval *rs_reqdata;
} req_extended_s; } req_extended_s;
typedef struct req_pwdexop_s { typedef struct req_pwdexop_s {
struct berval rs_reqoid; struct berval rs_reqoid;
int rs_flags;
struct berval rs_old; struct berval rs_old;
struct berval rs_new; struct berval rs_new;
Modifications *rs_mods; Modifications *rs_mods;
@ -2134,6 +2143,7 @@ typedef struct slap_op {
#define orm_increment oq_modify.rs_increment #define orm_increment oq_modify.rs_increment
#define ore_reqoid oq_extended.rs_reqoid #define ore_reqoid oq_extended.rs_reqoid
#define ore_flags oq_extended.rs_flags
#define ore_reqdata oq_extended.rs_reqdata #define ore_reqdata oq_extended.rs_reqdata
ldap_pvt_thread_t o_tid; /* thread handling this op */ ldap_pvt_thread_t o_tid; /* thread handling this op */