Skip to content
Snippets Groups Projects
Commit c9c1ee10 authored by Howard Chu's avatar Howard Chu
Browse files

Add LDAP_CONTROL_VALSORT

parent 6b63e25b
No related branches found
No related tags found
No related merge requests found
......@@ -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 );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment