mirror of
https://git.openldap.org/openldap/openldap.git
synced 2024-12-21 03:10:25 +08:00
cleanup for release engineering
This commit is contained in:
parent
32a3311156
commit
e323437c6a
@ -443,10 +443,12 @@ handle_private_option( int i )
|
||||
scope = LDAP_SCOPE_BASE;
|
||||
} else if ( strncasecmp( optarg, "one", sizeof("one")-1 ) == 0 ) {
|
||||
scope = LDAP_SCOPE_ONELEVEL;
|
||||
#ifdef LDAP_SCOPE_SUBORDINATE
|
||||
} else if (( strcasecmp( optarg, "subordinate" ) == 0 )
|
||||
|| ( strcasecmp( optarg, "children" ) == 0 ))
|
||||
{
|
||||
scope = LDAP_SCOPE_SUBORDINATE;
|
||||
#endif
|
||||
} else if ( strncasecmp( optarg, "sub", sizeof("sub")-1 ) == 0 ) {
|
||||
scope = LDAP_SCOPE_SUBTREE;
|
||||
} else {
|
||||
@ -764,8 +766,14 @@ getNextPage:
|
||||
base ? base : "",
|
||||
((scope == LDAP_SCOPE_BASE) ? "baseObject"
|
||||
: ((scope == LDAP_SCOPE_ONELEVEL) ? "oneLevel"
|
||||
#ifdef LDAP_SCOPE_SUBORDINATE
|
||||
: ((scope == LDAP_SCOPE_SUBORDINATE) ? "children"
|
||||
: "subtree"))));
|
||||
#endif
|
||||
: "subtree"
|
||||
#ifdef LDAP_SCOPE_SUBORDINATE
|
||||
)
|
||||
#endif
|
||||
)));
|
||||
printf(_("# filter%s: %s\n"), infile != NULL ? _(" pattern") : "",
|
||||
filtpattern);
|
||||
printf(_("# requesting: "));
|
||||
|
@ -223,8 +223,10 @@ typedef struct ldapcontrol {
|
||||
#define LDAP_CONTROL_VLVRESPONSE "2.16.840.1.113730.3.4.10"
|
||||
|
||||
/* Password policy Controls *//* work in progress */
|
||||
#ifdef LDAP_DEVEL
|
||||
#define LDAP_CONTROL_PASSWORDPOLICYREQUEST "1.3.6.1.4.1.42.2.27.8.5.1"
|
||||
#define LDAP_CONTROL_PASSWORDPOLICYRESPONSE "1.3.6.1.4.1.42.2.27.8.5.1"
|
||||
#endif
|
||||
|
||||
/* LDAP Sync -- draft-zeilenga-ldup-sync *//* submitted for publication */
|
||||
#define LDAP_SYNC_OID "1.3.6.1.4.1.4203.1.9.1"
|
||||
@ -282,6 +284,7 @@ typedef struct ldapcontrol {
|
||||
#define LDAP_EXOP_X_CANCEL "1.3.6.1.4.1.4203.666.6.3"
|
||||
|
||||
/* LDAP Grouping of Related Operations *//* a work in progress */
|
||||
#ifdef LDAP_DEVEL
|
||||
#define LDAP_X_GROUPING_BASE "1.3.6.1.4.1.4203.666.10.3"
|
||||
#define LDAP_EXOP_GROUPING_CREATE LDAP_X_GROUPING_BASE ".1"
|
||||
#define LDAP_EXOP_GROUPING_END LDAP_X_GROUPING_BASE ".2"
|
||||
@ -289,9 +292,12 @@ typedef struct ldapcontrol {
|
||||
#define LDAP_EXOP_GROUPING_ACTION LDAP_X_GROUPING_BASE ".4"
|
||||
#define LDAP_NOTICE_GROUPING_INFO LDAP_X_GROUPING_BASE ".5"
|
||||
#define LDAP_CONTROL_GROUPING LDAP_X_GROUPING_BASE ".6"
|
||||
#endif
|
||||
|
||||
/* LDAP Grouping Types *//* a work in progress */
|
||||
#ifdef LDAP_DEVEL
|
||||
#define LDAP_GROUP_TRANSACTION "1.3.6.1.4.1.4203.666.10.4"
|
||||
#endif
|
||||
|
||||
/* LDAP Features */
|
||||
#define LDAP_FEATURE_ALL_OP_ATTRS "1.3.6.1.4.1.4203.1.5.1" /* RFC 3673 */
|
||||
@ -301,10 +307,12 @@ typedef struct ldapcontrol {
|
||||
#define LDAP_FEATURE_LANGUAGE_TAG_OPTIONS "1.3.6.1.4.1.4203.1.5.4"
|
||||
#define LDAP_FEATURE_LANGUAGE_RANGE_OPTIONS "1.3.6.1.4.1.4203.1.5.5"
|
||||
|
||||
#ifdef LDAP_DEVEL
|
||||
#define LDAP_FEATURE_SUBORDINATE_SCOPE \
|
||||
"1.3.6.1.4.1.4203.666.8.1" /* "children" */
|
||||
#define LDAP_FEATURE_CHILDREN_SCOPE LDAP_FEATURE_SUBORDINATE_SCOPE
|
||||
#define LDAP_FEATURE_MODIFY_INCREMENT "1.3.6.1.4.1.4203.666.8.2"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* specific LDAP instantiations of BER types we know about
|
||||
@ -424,8 +432,10 @@ typedef struct ldapcontrol {
|
||||
#define LDAP_SCOPE_ONE LDAP_SCOPE_ONELEVEL
|
||||
#define LDAP_SCOPE_SUBTREE ((ber_int_t) 0x0002)
|
||||
#define LDAP_SCOPE_SUB LDAP_SCOPE_SUBTREE
|
||||
#ifdef LDAP_DEVEL
|
||||
#define LDAP_SCOPE_SUBORDINATE ((ber_int_t) 0x0003) /* OpenLDAP extension */
|
||||
#define LDAP_SCOPE_CHILDREN LDAP_SCOPE_SUBORDINATE
|
||||
#endif
|
||||
|
||||
/* substring filter component types */
|
||||
#define LDAP_SUBSTRING_INITIAL ((ber_tag_t) 0x80U) /* context specific */
|
||||
@ -744,7 +754,7 @@ ldap_parse_intermediate LDAP_P((
|
||||
*/
|
||||
|
||||
LDAP_F( int )
|
||||
ldap_grouping_create_operation LDAP_P((
|
||||
ldap_grouping_create LDAP_P((
|
||||
LDAP *ld,
|
||||
LDAP_CONST char *grpoid,
|
||||
struct berval *grpdata,
|
||||
@ -753,7 +763,7 @@ ldap_grouping_create_operation LDAP_P((
|
||||
int *msgidp ));
|
||||
|
||||
LDAP_F( int )
|
||||
ldap_grouping_create_operation_s LDAP_P((
|
||||
ldap_grouping_create_s LDAP_P((
|
||||
LDAP *ld,
|
||||
LDAP_CONST char *grpoid,
|
||||
struct berval *grpdata,
|
||||
@ -772,7 +782,7 @@ ldap_parse_grouping_create_result LDAP_P((
|
||||
int freeit ));
|
||||
|
||||
LDAP_F( int )
|
||||
ldap_grouping_end_operation LDAP_P((
|
||||
ldap_grouping_end LDAP_P((
|
||||
LDAP *ld,
|
||||
LDAP_CONST char *grpoid,
|
||||
struct berval *grpdata,
|
||||
@ -781,7 +791,7 @@ ldap_grouping_end_operation LDAP_P((
|
||||
int *msgidp ));
|
||||
|
||||
LDAP_F( int )
|
||||
ldap_grouping_end_operation_s LDAP_P((
|
||||
ldap_grouping_end_s LDAP_P((
|
||||
LDAP *ld,
|
||||
LDAP_CONST char *grpoid,
|
||||
struct berval *grpdata,
|
||||
@ -1844,6 +1854,7 @@ ldap_parse_vlv_control LDAP_P((
|
||||
* LDAP Transactions
|
||||
* in txn.c
|
||||
*/
|
||||
#ifdef LDAP_GROUPING_TRANSACTION
|
||||
LDAP_F( int )
|
||||
ldap_parse_txn_create LDAP_P((
|
||||
LDAP *ld,
|
||||
@ -1880,6 +1891,7 @@ ldap_txn_end_s LDAP_P((
|
||||
int commit,
|
||||
LDAPControl **sctrls,
|
||||
LDAPControl **cctrls ));
|
||||
#endif
|
||||
|
||||
/*
|
||||
* LDAP Who Am I?
|
||||
|
@ -26,5 +26,126 @@
|
||||
|
||||
#include "ldap-int.h"
|
||||
|
||||
#ifdef LDAP_EXOP_GROUPING_CREATE
|
||||
|
||||
int ldap_grouping_create(
|
||||
LDAP *ld,
|
||||
LDAP_CONST char *grpoid,
|
||||
struct berval *grpdata,
|
||||
LDAPControl **sctrls,
|
||||
LDAPControl **cctrls,
|
||||
int *msgidp )
|
||||
{
|
||||
int rc;
|
||||
BerElement *ber = NULL;
|
||||
struct berval bv = {0, NULL};
|
||||
|
||||
#ifdef NEW_LOGGING
|
||||
LDAP_LOG ( OPERATION, ENTRY, "ldap_grouping_create\n", 0,0,0 );
|
||||
#else
|
||||
Debug( LDAP_DEBUG_TRACE, "ldap_grouping_create\n", 0, 0, 0 );
|
||||
#endif
|
||||
|
||||
assert( ld != NULL );
|
||||
assert( LDAP_VALID( ld ) );
|
||||
assert( grpoid != NULL || *grpoid == '\0' );
|
||||
assert( msgidp != NULL );
|
||||
|
||||
/* build the create grouping exop */
|
||||
ber = ber_alloc_t( LBER_USE_DER );
|
||||
if( ber == NULL ) {
|
||||
ld->ld_errno = LDAP_NO_MEMORY;
|
||||
return( ld->ld_errno );
|
||||
}
|
||||
|
||||
if ( grpdata != NULL ) {
|
||||
ber_printf( ber, "{sON}", grpoid, grpdata );
|
||||
} else {
|
||||
ber_printf( ber, "{sN}", grpoid );
|
||||
}
|
||||
|
||||
rc = ber_flatten2( ber, &bv, 0 );
|
||||
|
||||
if( rc < 0 ) {
|
||||
ld->ld_errno = LDAP_ENCODING_ERROR;
|
||||
return( ld->ld_errno );
|
||||
}
|
||||
|
||||
rc = ldap_extended_operation( ld, LDAP_EXOP_GROUPING_CREATE,
|
||||
&bv, sctrls, cctrls, msgidp );
|
||||
|
||||
ber_free( ber, 1 );
|
||||
return rc;
|
||||
}
|
||||
|
||||
int ldap_grouping_create_s(
|
||||
LDAP *ld,
|
||||
LDAP_CONST char *grpoid,
|
||||
struct berval *grpdata,
|
||||
LDAPControl **sctrls,
|
||||
LDAPControl **cctrls,
|
||||
struct berval **retgrpcookiep,
|
||||
struct berval **retgrpdatap )
|
||||
{
|
||||
int rc;
|
||||
int msgid;
|
||||
LDAPMessage *res;
|
||||
|
||||
#ifdef NEW_LOGGING
|
||||
LDAP_LOG ( OPERATION, ENTRY, "ldap_grouping_create_s\n", 0,0,0 );
|
||||
#else
|
||||
Debug( LDAP_DEBUG_TRACE, "ldap_grouping_create_s\n", 0, 0, 0 );
|
||||
#endif
|
||||
|
||||
assert( ld != NULL );
|
||||
assert( LDAP_VALID( ld ) );
|
||||
assert( grpoid != NULL || *grpoid == '\0' );
|
||||
|
||||
rc = ldap_grouping_create( ld, grpoid, grpdata,
|
||||
sctrls, cctrls, &msgid );
|
||||
if ( rc != LDAP_SUCCESS ) {
|
||||
return rc;
|
||||
}
|
||||
|
||||
if ( ldap_result( ld, msgid, 1, (struct timeval *) NULL, &res ) == -1 ) {
|
||||
return ld->ld_errno;
|
||||
}
|
||||
|
||||
if ( retgrpcookiep != NULL ) *retgrpcookiep = NULL;
|
||||
if ( retgrpdatap != NULL ) *retgrpdatap = NULL;
|
||||
|
||||
#if 0
|
||||
rc = ldap_parse_extended_result( ld, res, retoidp, retdatap, 0 );
|
||||
#else
|
||||
rc = LDAP_NOT_SUPPORTED;
|
||||
#endif
|
||||
|
||||
if( rc != LDAP_SUCCESS ) {
|
||||
ldap_msgfree( res );
|
||||
return rc;
|
||||
}
|
||||
|
||||
return( ldap_result2error( ld, res, 1 ) );
|
||||
}
|
||||
|
||||
int ldap_grouping_end(
|
||||
LDAP *ld,
|
||||
LDAP_CONST char *grpoid,
|
||||
struct berval *grpdata,
|
||||
LDAPControl **sctrls,
|
||||
LDAPControl **cctrls,
|
||||
int *msgidp )
|
||||
{
|
||||
}
|
||||
|
||||
int ldap_grouping_end_s(
|
||||
LDAP *ld,
|
||||
LDAP_CONST char *grpoid,
|
||||
struct berval *grpdata,
|
||||
LDAPControl **sctrls,
|
||||
LDAPControl **cctrls,
|
||||
struct berval **retgrpdatap )
|
||||
{
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -640,7 +640,9 @@ main( int argc, char **argv )
|
||||
ludp->lud_scope == LDAP_SCOPE_BASE ? "baseObject"
|
||||
: ludp->lud_scope == LDAP_SCOPE_ONELEVEL ? "oneLevel"
|
||||
: ludp->lud_scope == LDAP_SCOPE_SUBTREE ? "subtree"
|
||||
#ifdef LDAP_SCOPE_SUBORDINATE
|
||||
: ludp->lud_scope == LDAP_SCOPE_SUBORDINATE ? "children"
|
||||
#endif
|
||||
: "**invalid**" );
|
||||
printf( "\tfilter: <%s>\n", ludp->lud_filter );
|
||||
ldap_free_urldesc( ludp );
|
||||
|
@ -26,6 +26,8 @@
|
||||
|
||||
#include "ldap-int.h"
|
||||
|
||||
#ifdef LDAP_GROUP_TRANSACTION
|
||||
|
||||
int
|
||||
ldap_txn_create_s(
|
||||
LDAP *ld,
|
||||
@ -46,3 +48,5 @@ ldap_txn_end_s(
|
||||
{
|
||||
return LDAP_NOT_SUPPORTED;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
@ -246,7 +246,7 @@ static int str2scope( const char *p )
|
||||
} else if ( strcasecmp( p, "subtree" ) == 0 ) {
|
||||
return LDAP_SCOPE_SUBTREE;
|
||||
|
||||
#ifdef LDAP_FEATURE_SUBORDINATE_SCOPE
|
||||
#ifdef LDAP_SCOPE_SUBORDINATE
|
||||
} else if ( strcasecmp( p, "subordinate" ) == 0 ) {
|
||||
return LDAP_SCOPE_SUBORDINATE;
|
||||
|
||||
|
@ -969,9 +969,11 @@ id2entry_retry:
|
||||
if ( ei->bei_parent->bei_id == base.e_id ) scopeok = 1;
|
||||
break;
|
||||
|
||||
#ifdef LDAP_SCOPE_CHILDREN
|
||||
case LDAP_SCOPE_CHILDREN:
|
||||
if ( id == base.e_id ) break;
|
||||
/* Fall-thru */
|
||||
#endif
|
||||
case LDAP_SCOPE_SUBTREE: {
|
||||
EntryInfo *tmp;
|
||||
for (tmp = BEI(e); tmp->bei_parent;
|
||||
|
@ -89,8 +89,10 @@ filter_candidates(
|
||||
}
|
||||
break;
|
||||
|
||||
#ifdef SLAPD_FILTER_DN_CHILDREN
|
||||
case SLAPD_FILTER_DN_CHILDREN:
|
||||
sub = "CHILDREN";
|
||||
#endif
|
||||
case SLAPD_FILTER_DN_SUBTREE:
|
||||
#ifdef NEW_LOGGING
|
||||
LDAP_LOG( FILTER, DETAIL1,
|
||||
|
@ -347,11 +347,13 @@ searchit:
|
||||
{
|
||||
scopeok = dnIsSuffix( &e->e_nname, &realbase );
|
||||
|
||||
#ifdef LDAP_SCOPE_SUBORDINATE
|
||||
} else if ( !scopeok
|
||||
&& op->ors_scope == LDAP_SCOPE_SUBORDINATE )
|
||||
{
|
||||
scopeok = !dn_match( &e->e_nname, &realbase )
|
||||
&& dnIsSuffix( &e->e_nname, &realbase );
|
||||
#endif
|
||||
|
||||
} else {
|
||||
scopeok = 1;
|
||||
@ -409,11 +411,13 @@ searchit:
|
||||
{
|
||||
scopeok = dnIsSuffix( &e->e_nname, &realbase );
|
||||
|
||||
#ifdef LDAP_SCOPE_SUBORDINATE
|
||||
} else if ( !scopeok &&
|
||||
op->ors_scope == LDAP_SCOPE_SUBORDINATE )
|
||||
{
|
||||
scopeok = !dn_match( &e->e_nname, &realbase )
|
||||
&& dnIsSuffix( &e->e_nname, &realbase );
|
||||
#endif
|
||||
|
||||
} else {
|
||||
scopeok = 1;
|
||||
|
@ -1289,12 +1289,14 @@ backend_group(
|
||||
case LDAP_SCOPE_SUBTREE:
|
||||
if ( !dnIsSuffix( op_ndn, &nbase )) goto loopit;
|
||||
break;
|
||||
#ifdef LDAP_SCOPE_SUBORDINATE
|
||||
case LDAP_SCOPE_SUBORDINATE:
|
||||
if ( dn_match( &nbase, op_ndn ) &&
|
||||
!dnIsSuffix(op_ndn, &nbase ))
|
||||
{
|
||||
goto loopit;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
filter = str2filter_x( op, ludp->lud_filter );
|
||||
if ( filter ) {
|
||||
|
@ -281,7 +281,9 @@ glue_back_search ( Operation *op, SlapReply *rs )
|
||||
|
||||
case LDAP_SCOPE_ONELEVEL:
|
||||
case LDAP_SCOPE_SUBTREE:
|
||||
#ifdef LDAP_SCOPE_SUBORDINATE
|
||||
case LDAP_SCOPE_SUBORDINATE: /* FIXME */
|
||||
#endif
|
||||
op->o_callback = &cb;
|
||||
rs->sr_err = gs.err = LDAP_UNWILLING_TO_PERFORM;
|
||||
scope0 = op->ors_scope;
|
||||
|
@ -3100,10 +3100,12 @@ parse_syncrepl_line(
|
||||
si->si_scope = LDAP_SCOPE_BASE;
|
||||
} else if ( !strncasecmp( val, "one", sizeof( "one" ) - 1 )) {
|
||||
si->si_scope = LDAP_SCOPE_ONELEVEL;
|
||||
#ifdef LDAP_SCOPE_SUBORDINATE
|
||||
} else if ( !strcasecmp( val, "subordinate" ) ||
|
||||
!strcasecmp( val, "children" ))
|
||||
{
|
||||
si->si_scope = LDAP_SCOPE_SUBORDINATE;
|
||||
#endif
|
||||
} else if ( !strncasecmp( val, "sub", sizeof( "sub" ) - 1 )) {
|
||||
si->si_scope = LDAP_SCOPE_SUBTREE;
|
||||
} else {
|
||||
|
@ -898,7 +898,9 @@ void slap_sasl2dn( Operation *opx,
|
||||
|
||||
case LDAP_SCOPE_ONELEVEL:
|
||||
case LDAP_SCOPE_SUBTREE:
|
||||
#ifdef LDAP_SCOPE_SUBORDINATE
|
||||
case LDAP_SCOPE_SUBORDINATE:
|
||||
#endif
|
||||
/* do a search */
|
||||
break;
|
||||
|
||||
|
@ -102,7 +102,9 @@ do_search(
|
||||
case LDAP_SCOPE_BASE:
|
||||
case LDAP_SCOPE_ONELEVEL:
|
||||
case LDAP_SCOPE_SUBTREE:
|
||||
#ifdef LDAP_SCOPE_SUBORDINATE
|
||||
case LDAP_SCOPE_SUBORDINATE:
|
||||
#endif
|
||||
break;
|
||||
default:
|
||||
send_ldap_error( op, rs, LDAP_PROTOCOL_ERROR, "invalid scope" );
|
||||
|
@ -875,7 +875,9 @@ typedef struct slap_filter {
|
||||
#define SLAPD_FILTER_COMPUTED ((ber_tag_t) -1)
|
||||
#define SLAPD_FILTER_DN_ONE ((ber_tag_t) -2)
|
||||
#define SLAPD_FILTER_DN_SUBTREE ((ber_tag_t) -3)
|
||||
#ifdef LDAP_SCOPE_SUBORDINATE
|
||||
#define SLAPD_FILTER_DN_CHILDREN ((ber_tag_t) -4)
|
||||
#endif
|
||||
|
||||
union f_un_u {
|
||||
/* precomputed result */
|
||||
|
Loading…
Reference in New Issue
Block a user