mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-24 00:29:35 -05:00
Test PermitModify and NoReferrals controls (note that PermitModify is
ignored for the moment - will be fixed shortly)
This commit is contained in:
parent
eec370af52
commit
7759f75d76
1 changed files with 62 additions and 0 deletions
|
|
@ -49,6 +49,8 @@ static SLAP_CTRL_PARSE_FN parseManageDSAit;
|
|||
static SLAP_CTRL_PARSE_FN parseNoOp;
|
||||
static SLAP_CTRL_PARSE_FN parsePagedResults;
|
||||
static SLAP_CTRL_PARSE_FN parseValuesReturnFilter;
|
||||
static SLAP_CTRL_PARSE_FN parsePermitModify;
|
||||
static SLAP_CTRL_PARSE_FN parseNoReferrals;
|
||||
|
||||
#ifdef LDAP_CONTROL_SUBENTRIES
|
||||
static SLAP_CTRL_PARSE_FN parseSubentries;
|
||||
|
|
@ -92,6 +94,16 @@ static struct slap_control {
|
|||
SLAP_CTRL_SEARCH, NULL,
|
||||
parseSubentries },
|
||||
#endif
|
||||
#ifdef LDAP_CONTROL_PERMITMODIFY
|
||||
{ LDAP_CONTROL_PERMITMODIFY,
|
||||
SLAP_CTRL_UPDATE, NULL,
|
||||
parsePermitModify },
|
||||
#endif
|
||||
#ifdef LDAP_CONTROL_NOREFERRALS
|
||||
{ LDAP_CONTROL_NOREFERRALS,
|
||||
SLAP_CTRL_SEARCH, NULL,
|
||||
parseNoReferrals },
|
||||
#endif
|
||||
#ifdef LDAP_CLIENT_UPDATE
|
||||
{ LDAP_CONTROL_CLIENT_UPDATE,
|
||||
SLAP_CTRL_SEARCH, NULL,
|
||||
|
|
@ -747,6 +759,56 @@ static int parseSubentries (
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef LDAP_CONTROL_PERMITMODIFY
|
||||
static int parsePermitModify (
|
||||
Connection *conn,
|
||||
Operation *op,
|
||||
LDAPControl *ctrl,
|
||||
const char **text )
|
||||
{
|
||||
if ( op->o_permitmodify != SLAP_NO_CONTROL ) {
|
||||
*text = "permitmodify control specified multiple times";
|
||||
return LDAP_PROTOCOL_ERROR;
|
||||
}
|
||||
|
||||
if ( ctrl->ldctl_value.bv_len ) {
|
||||
*text = "permitmodify control value not empty";
|
||||
return LDAP_PROTOCOL_ERROR;
|
||||
}
|
||||
|
||||
op->o_permitmodify = ctrl->ldctl_iscritical
|
||||
? SLAP_CRITICAL_CONTROL
|
||||
: SLAP_NONCRITICAL_CONTROL;
|
||||
|
||||
return LDAP_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LDAP_CONTROL_NOREFERRALS
|
||||
static int parseNoReferrals (
|
||||
Connection *conn,
|
||||
Operation *op,
|
||||
LDAPControl *ctrl,
|
||||
const char **text )
|
||||
{
|
||||
if ( op->o_noreferrals != SLAP_NO_CONTROL ) {
|
||||
*text = "noreferrals control specified multiple times";
|
||||
return LDAP_PROTOCOL_ERROR;
|
||||
}
|
||||
|
||||
if ( ctrl->ldctl_value.bv_len ) {
|
||||
*text = "noreferrals control value not empty";
|
||||
return LDAP_PROTOCOL_ERROR;
|
||||
}
|
||||
|
||||
op->o_noreferrals = ctrl->ldctl_iscritical
|
||||
? SLAP_CRITICAL_CONTROL
|
||||
: SLAP_NONCRITICAL_CONTROL;
|
||||
|
||||
return LDAP_SUCCESS;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef LDAP_CLIENT_UPDATE
|
||||
static int parseClientUpdate (
|
||||
Connection *conn,
|
||||
|
|
|
|||
Loading…
Reference in a new issue