mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
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:
parent
c7a8625da7
commit
c8f49d0337
@ -45,11 +45,6 @@
|
||||
|
||||
#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;
|
||||
@ -77,7 +72,7 @@ static struct {
|
||||
} 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
|
||||
@ -225,6 +220,8 @@ fe_extended( Operation *op, SlapReply *rs )
|
||||
goto done;
|
||||
}
|
||||
|
||||
op->ore_flags = ext->flags;
|
||||
|
||||
Debug( LDAP_DEBUG_ARGS, "do_extended: oid=%s\n",
|
||||
op->ore_reqoid.bv_val, 0 ,0 );
|
||||
|
||||
|
@ -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));
|
||||
|
||||
#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_WHOAMI;
|
||||
LDAP_SLAPD_V( const struct berval ) slap_EXOP_MODIFY_PASSWD;
|
||||
|
@ -1696,13 +1696,22 @@ typedef struct req_abandon_s {
|
||||
ber_int_t rs_msgid;
|
||||
} 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 {
|
||||
struct berval rs_reqoid;
|
||||
int rs_flags;
|
||||
struct berval *rs_reqdata;
|
||||
} req_extended_s;
|
||||
|
||||
typedef struct req_pwdexop_s {
|
||||
struct berval rs_reqoid;
|
||||
int rs_flags;
|
||||
struct berval rs_old;
|
||||
struct berval rs_new;
|
||||
Modifications *rs_mods;
|
||||
@ -2134,6 +2143,7 @@ typedef struct slap_op {
|
||||
#define orm_increment oq_modify.rs_increment
|
||||
|
||||
#define ore_reqoid oq_extended.rs_reqoid
|
||||
#define ore_flags oq_extended.rs_flags
|
||||
#define ore_reqdata oq_extended.rs_reqdata
|
||||
|
||||
ldap_pvt_thread_t o_tid; /* thread handling this op */
|
||||
|
Loading…
Reference in New Issue
Block a user