#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"
slap_mask_t vi_sort;
} valsort_info;
+static int valsort_cid;
+
static ConfigDriver valsort_cf_func;
static ConfigTable valsort_cfats[] = {
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()
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 );