mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-04-12 15:10:31 +08:00
Add LDAP_CONTROL_VALSORT
This commit is contained in:
parent
6b63e25bc2
commit
c9c1ee10b3
@ -223,6 +223,7 @@ typedef struct ldapcontrol {
|
||||
#define LDAP_CONTROL_NO_SUBORDINATES "1.3.6.1.4.1.4203.666.5.11"
|
||||
#define LDAP_CONTROL_MANAGEDIT "1.3.6.1.4.1.4203.666.5.12"
|
||||
#define LDAP_CONTROL_SLURP "1.3.6.1.4.1.4203.666.5.13"
|
||||
#define LDAP_CONTROL_VALSORT "1.3.6.1.4.1.4203.666.5.14"
|
||||
|
||||
/* LDAP Duplicated Entry Control Extension *//* not implemented in slapd(8) */
|
||||
#define LDAP_CONTROL_DUPENT_REQUEST "2.16.840.1.113719.1.27.101.1"
|
||||
|
@ -51,6 +51,8 @@ typedef struct valsort_info {
|
||||
slap_mask_t vi_sort;
|
||||
} valsort_info;
|
||||
|
||||
static int valsort_cid;
|
||||
|
||||
static ConfigDriver valsort_cf_func;
|
||||
|
||||
static ConfigTable valsort_cfats[] = {
|
||||
@ -481,6 +483,22 @@ valsort_destroy(
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int
|
||||
valsort_parseCtrl(
|
||||
Operation *op,
|
||||
SlapReply *rs,
|
||||
LDAPControl *ctrl )
|
||||
{
|
||||
if ( ctrl->ldctl_value.bv_len ) {
|
||||
rs->sr_text = "valSort control value not empty";
|
||||
return LDAP_PROTOCOL_ERROR;
|
||||
}
|
||||
op->o_ctrlflag[valsort_cid] = ctrl->ldctl_iscritical ?
|
||||
SLAP_CONTROL_CRITICAL : SLAP_CONTROL_NONCRITICAL;
|
||||
|
||||
return LDAP_SUCCESS;
|
||||
}
|
||||
|
||||
static slap_overinst valsort;
|
||||
|
||||
int valsort_init()
|
||||
@ -497,6 +515,14 @@ int valsort_init()
|
||||
|
||||
valsort.on_bi.bi_cf_ocs = valsort_cfocs;
|
||||
|
||||
rc = register_supported_control( LDAP_CONTROL_VALSORT,
|
||||
SLAP_CTRL_SEARCH | SLAP_CTRL_HIDE, NULL, valsort_parseCtrl,
|
||||
&valsort_cid );
|
||||
if ( rc != LDAP_SUCCESS ) {
|
||||
fprintf( stderr, "Failed to register control %d\n", rc );
|
||||
return rc;
|
||||
}
|
||||
|
||||
syn_numericString = syn_find( "1.3.6.1.4.1.1466.115.121.1.36" );
|
||||
|
||||
rc = config_register_schema( valsort_cfats, valsort_cfocs );
|
||||
|
Loading…
x
Reference in New Issue
Block a user