mirror of
https://git.openldap.org/openldap/openldap.git
synced 2025-12-22 07:39:35 -05:00
Proxy cache patch (by Jong, Apurva, & Kurt)
1. Glueing patch for proxy cache 2. test script update to avoid schema checking voilations (attributes set) 3. configuration patch for proxy cache
This commit is contained in:
parent
264f690c81
commit
d113166475
10 changed files with 186 additions and 347 deletions
6
configure
vendored
6
configure
vendored
|
|
@ -2882,6 +2882,7 @@ BUILD_LDAP=no
|
||||||
BUILD_LDBM=no
|
BUILD_LDBM=no
|
||||||
BUILD_META=no
|
BUILD_META=no
|
||||||
BUILD_MONITOR=no
|
BUILD_MONITOR=no
|
||||||
|
BUILD_CACHE=no
|
||||||
BUILD_NULL=no
|
BUILD_NULL=no
|
||||||
BUILD_PASSWD=no
|
BUILD_PASSWD=no
|
||||||
BUILD_PERL=no
|
BUILD_PERL=no
|
||||||
|
|
@ -23271,6 +23272,10 @@ EOF
|
||||||
BUILD_SLAPD=yes
|
BUILD_SLAPD=yes
|
||||||
BUILD_META=yes
|
BUILD_META=yes
|
||||||
BUILD_REWRITE=yes
|
BUILD_REWRITE=yes
|
||||||
|
if test $ol_enable_ldbm = yes -o \
|
||||||
|
$ol_enable_bdb = yes ; then
|
||||||
|
BUILD_CACHE=yes
|
||||||
|
fi
|
||||||
if test "$ol_with_meta_module" != static ; then
|
if test "$ol_with_meta_module" != static ; then
|
||||||
cat >> confdefs.h <<\EOF
|
cat >> confdefs.h <<\EOF
|
||||||
#define SLAPD_META_DYNAMIC 1
|
#define SLAPD_META_DYNAMIC 1
|
||||||
|
|
@ -23740,6 +23745,7 @@ s%@BUILD_LDAP@%$BUILD_LDAP%g
|
||||||
s%@BUILD_LDBM@%$BUILD_LDBM%g
|
s%@BUILD_LDBM@%$BUILD_LDBM%g
|
||||||
s%@BUILD_META@%$BUILD_META%g
|
s%@BUILD_META@%$BUILD_META%g
|
||||||
s%@BUILD_MONITOR@%$BUILD_MONITOR%g
|
s%@BUILD_MONITOR@%$BUILD_MONITOR%g
|
||||||
|
s%@BUILD_CACHE@%$BUILD_CACHE%g
|
||||||
s%@BUILD_NULL@%$BUILD_NULL%g
|
s%@BUILD_NULL@%$BUILD_NULL%g
|
||||||
s%@BUILD_PASSWD@%$BUILD_PASSWD%g
|
s%@BUILD_PASSWD@%$BUILD_PASSWD%g
|
||||||
s%@BUILD_PERL@%$BUILD_PERL%g
|
s%@BUILD_PERL@%$BUILD_PERL%g
|
||||||
|
|
|
||||||
|
|
@ -541,6 +541,7 @@ BUILD_LDAP=no
|
||||||
BUILD_LDBM=no
|
BUILD_LDBM=no
|
||||||
BUILD_META=no
|
BUILD_META=no
|
||||||
BUILD_MONITOR=no
|
BUILD_MONITOR=no
|
||||||
|
BUILD_CACHE=no
|
||||||
BUILD_NULL=no
|
BUILD_NULL=no
|
||||||
BUILD_PASSWD=no
|
BUILD_PASSWD=no
|
||||||
BUILD_PERL=no
|
BUILD_PERL=no
|
||||||
|
|
@ -2663,6 +2664,10 @@ if test "$ol_enable_meta" != no ; then
|
||||||
BUILD_SLAPD=yes
|
BUILD_SLAPD=yes
|
||||||
BUILD_META=yes
|
BUILD_META=yes
|
||||||
BUILD_REWRITE=yes
|
BUILD_REWRITE=yes
|
||||||
|
if test $ol_enable_ldbm = yes -o \
|
||||||
|
$ol_enable_bdb = yes ; then
|
||||||
|
BUILD_CACHE=yes
|
||||||
|
fi
|
||||||
if test "$ol_with_meta_module" != static ; then
|
if test "$ol_with_meta_module" != static ; then
|
||||||
AC_DEFINE(SLAPD_META_DYNAMIC,1,
|
AC_DEFINE(SLAPD_META_DYNAMIC,1,
|
||||||
[define to support dynamic LDAP Metadirectory backend])
|
[define to support dynamic LDAP Metadirectory backend])
|
||||||
|
|
@ -2832,6 +2837,7 @@ AC_SUBST(BUILD_SLAPD)
|
||||||
AC_SUBST(BUILD_LDBM)
|
AC_SUBST(BUILD_LDBM)
|
||||||
AC_SUBST(BUILD_META)
|
AC_SUBST(BUILD_META)
|
||||||
AC_SUBST(BUILD_MONITOR)
|
AC_SUBST(BUILD_MONITOR)
|
||||||
|
AC_SUBST(BUILD_CACHE)
|
||||||
AC_SUBST(BUILD_NULL)
|
AC_SUBST(BUILD_NULL)
|
||||||
AC_SUBST(BUILD_PASSWD)
|
AC_SUBST(BUILD_PASSWD)
|
||||||
AC_SUBST(BUILD_PERL)
|
AC_SUBST(BUILD_PERL)
|
||||||
|
|
|
||||||
|
|
@ -38,30 +38,12 @@
|
||||||
|
|
||||||
static struct berval bv_queryid_any = BER_BVC( "(queryid=*)" );
|
static struct berval bv_queryid_any = BER_BVC( "(queryid=*)" );
|
||||||
|
|
||||||
static int
|
|
||||||
merge_func (
|
|
||||||
Operation *op,
|
|
||||||
SlapReply *rs
|
|
||||||
);
|
|
||||||
|
|
||||||
static void
|
|
||||||
add_func (
|
|
||||||
Operation *op,
|
|
||||||
SlapReply *rs
|
|
||||||
);
|
|
||||||
|
|
||||||
static Attribute*
|
static Attribute*
|
||||||
add_attribute(AttributeDescription *ad,
|
add_attribute(AttributeDescription *ad,
|
||||||
Entry* e,
|
Entry* e,
|
||||||
BerVarray value_array
|
BerVarray value_array
|
||||||
);
|
);
|
||||||
|
|
||||||
static int
|
|
||||||
get_size_func (
|
|
||||||
Operation *op,
|
|
||||||
SlapReply *rs
|
|
||||||
);
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
null_response (
|
null_response (
|
||||||
Operation *op,
|
Operation *op,
|
||||||
|
|
@ -116,25 +98,6 @@ get_entry_size(
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* quick hack: call the right callback */
|
|
||||||
static int
|
|
||||||
add_merge_func( Operation *op, SlapReply *rs )
|
|
||||||
{
|
|
||||||
switch ( rs->sr_type ) {
|
|
||||||
case REP_SEARCH:
|
|
||||||
merge_func( op, rs );
|
|
||||||
break;
|
|
||||||
|
|
||||||
case REP_RESULT:
|
|
||||||
add_func( op, rs );
|
|
||||||
break;
|
|
||||||
|
|
||||||
default:
|
|
||||||
assert( 0 );
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
int
|
int
|
||||||
merge_entry(
|
merge_entry(
|
||||||
Operation *op,
|
Operation *op,
|
||||||
|
|
@ -143,278 +106,102 @@ merge_entry(
|
||||||
struct exception* result )
|
struct exception* result )
|
||||||
{
|
{
|
||||||
struct entry_info info;
|
struct entry_info info;
|
||||||
struct berval normdn;
|
int rc;
|
||||||
struct berval prettydn;
|
Modifications* modlist = NULL;
|
||||||
|
const char* text = NULL;
|
||||||
|
BerVarray value_array;
|
||||||
|
Attribute *uuid_attr, *attr;
|
||||||
|
Entry *e;
|
||||||
|
|
||||||
SlapReply sreply = {REP_RESULT};
|
SlapReply sreply = {REP_RESULT};
|
||||||
|
|
||||||
Operation op_tmp = *op;
|
Operation op_tmp = *op;
|
||||||
slap_callback cb = { add_merge_func, NULL };
|
slap_callback cb;
|
||||||
|
|
||||||
Filter* filter = str2filter( bv_queryid_any.bv_val );
|
|
||||||
sreply.sr_entry = NULL;
|
sreply.sr_entry = NULL;
|
||||||
sreply.sr_nentries = 0;
|
sreply.sr_nentries = 0;
|
||||||
|
|
||||||
dnPrettyNormal(0, &rs->sr_entry->e_name, &prettydn, &normdn,
|
e = ( Entry * ) ch_calloc( 1, sizeof( Entry ));
|
||||||
op->o_tmpmemctx);
|
dnPrettyNormal(0, &rs->sr_entry->e_name, &e->e_name, &e->e_nname, op->o_tmpmemctx);
|
||||||
|
|
||||||
free(rs->sr_entry->e_name.bv_val);
|
e->e_private = NULL;
|
||||||
rs->sr_entry->e_name = prettydn;
|
e->e_attrs = NULL;
|
||||||
if (rs->sr_entry->e_nname.bv_val) free(rs->sr_entry->e_nname.bv_val);
|
e->e_bv.bv_val = NULL;
|
||||||
rs->sr_entry->e_nname = normdn;
|
|
||||||
|
|
||||||
info.entry = rs->sr_entry;
|
/* add queryid attribute */
|
||||||
|
value_array = (struct berval *)malloc(2 * sizeof( struct berval) );
|
||||||
|
ber_dupbv(value_array, query_uuid);
|
||||||
|
value_array[1].bv_val = NULL;
|
||||||
|
value_array[1].bv_len = 0;
|
||||||
|
|
||||||
|
uuid_attr = add_attribute(slap_schema.si_ad_queryid, e, value_array);
|
||||||
|
|
||||||
|
/* append the attribute list from the fetched entry */
|
||||||
|
uuid_attr->a_next = rs->sr_entry->e_attrs;
|
||||||
|
rs->sr_entry->e_attrs = NULL;
|
||||||
|
|
||||||
|
for ( attr = e->e_attrs; attr; attr = attr->a_next ) {
|
||||||
|
if ( normalize_values( attr ) ) {
|
||||||
|
info.err = MERGE_ERR;
|
||||||
|
result->rc = info.err;
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
info.entry = e;
|
||||||
info.uuid = query_uuid;
|
info.uuid = query_uuid;
|
||||||
info.size_init = 0;
|
info.size_init = get_entry_size( rs->sr_entry, 0, 0 );
|
||||||
info.size_final = 0;
|
info.size_final = 0;
|
||||||
info.added = 0;
|
info.added = 0;
|
||||||
info.glue_be = op->o_bd;
|
info.glue_be = op->o_bd;
|
||||||
info.err = SUCCESS;
|
info.err = SUCCESS;
|
||||||
cb.sc_private = &info;
|
cb.sc_private = &info;
|
||||||
|
cb.sc_response = null_response;
|
||||||
|
|
||||||
op_tmp.o_tag = LDAP_REQ_SEARCH;
|
op_tmp.o_tag = LDAP_REQ_ADD;
|
||||||
op_tmp.o_protocol = LDAP_VERSION3;
|
op_tmp.o_protocol = LDAP_VERSION3;
|
||||||
op_tmp.o_callback = &cb;
|
op_tmp.o_callback = &cb;
|
||||||
op_tmp.o_caching_on = 1;
|
op_tmp.o_caching_on = 0;
|
||||||
op_tmp.o_time = slap_get_time();
|
op_tmp.o_time = slap_get_time();
|
||||||
op_tmp.o_do_not_cache = 1;
|
op_tmp.o_do_not_cache = 1;
|
||||||
|
|
||||||
op_tmp.o_req_dn = rs->sr_entry->e_name;
|
op_tmp.ora_e = e;
|
||||||
op_tmp.o_req_ndn = rs->sr_entry->e_nname;
|
op_tmp.o_req_dn = e->e_name;
|
||||||
op_tmp.ors_scope = LDAP_SCOPE_BASE;
|
op_tmp.o_req_ndn = e->e_nname;
|
||||||
op_tmp.ors_deref = LDAP_DEREF_NEVER;
|
rc = op->o_bd->be_add( &op_tmp, &sreply );
|
||||||
op_tmp.ors_slimit = 1;
|
|
||||||
op_tmp.ors_tlimit = 0;
|
|
||||||
op_tmp.ors_filter = filter;
|
|
||||||
op_tmp.ors_filterstr = bv_queryid_any;
|
|
||||||
op_tmp.ors_attrs = NULL;
|
|
||||||
op_tmp.ors_attrsonly = 0;
|
|
||||||
|
|
||||||
op->o_bd->be_search( &op_tmp, &sreply );
|
if ( rc != LDAP_SUCCESS ) {
|
||||||
result->type = info.err;
|
if ( rc == LDAP_ALREADY_EXISTS ) {
|
||||||
if ( result->type == SUCCESS )
|
slap_entry2mods( e, &modlist, &text );
|
||||||
|
op_tmp.o_tag = LDAP_REQ_MODIFY;
|
||||||
|
op_tmp.orm_modlist = modlist;
|
||||||
|
op_tmp.o_req_dn = e->e_name;
|
||||||
|
op_tmp.o_req_ndn = e->e_nname;
|
||||||
|
rc = op->o_bd->be_modify( &op_tmp, &sreply );
|
||||||
result->rc = info.added;
|
result->rc = info.added;
|
||||||
else
|
} else if ( rc == LDAP_REFERRAL ||
|
||||||
|
rc == LDAP_NO_SUCH_OBJECT ) {
|
||||||
|
slap_entry2mods( e, &modlist, &text );
|
||||||
|
syncrepl_add_glue( NULL, NULL, &op_tmp, e, modlist, 0, NULL, NULL );
|
||||||
|
result->rc = info.added;
|
||||||
|
} else {
|
||||||
result->rc = 0;
|
result->rc = 0;
|
||||||
|
}
|
||||||
|
if ( modlist != NULL ) slap_mods_free( modlist );
|
||||||
|
} else {
|
||||||
|
info.size_init = 0;
|
||||||
|
result->rc = info.added;
|
||||||
|
be_entry_release_w( &op_tmp, e );
|
||||||
|
}
|
||||||
|
|
||||||
|
if ( result->rc )
|
||||||
|
info.size_final = get_entry_size( e, info.size_init, result );
|
||||||
|
else
|
||||||
|
info.size_final = info.size_init;
|
||||||
|
|
||||||
return ( info.size_final - info.size_init );
|
return ( info.size_final - info.size_init );
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
merge_func (
|
|
||||||
Operation *op,
|
|
||||||
SlapReply *rs
|
|
||||||
)
|
|
||||||
{
|
|
||||||
Backend *be;
|
|
||||||
char *new_attr_name;
|
|
||||||
Attribute *a_new, *a;
|
|
||||||
int i = 0;
|
|
||||||
int rc = 0;
|
|
||||||
|
|
||||||
int count;
|
|
||||||
struct timeval time; /* time */
|
|
||||||
long timediff; /* time */
|
|
||||||
struct entry_info *info = op->o_callback->sc_private;
|
|
||||||
Filter *filter = str2filter( bv_queryid_any.bv_val );
|
|
||||||
Entry *entry = info->entry;
|
|
||||||
struct berval *uuid = info->uuid;
|
|
||||||
Modifications *modhead = NULL;
|
|
||||||
Modifications *mod;
|
|
||||||
Modifications **modtail = &modhead;
|
|
||||||
AttributeDescription *a_new_desc;
|
|
||||||
const char *text = NULL;
|
|
||||||
Operation op_tmp = *op;
|
|
||||||
SlapReply sreply = {REP_RESULT};
|
|
||||||
SlapReply sreply1 = {REP_RESULT};
|
|
||||||
|
|
||||||
info->err = SUCCESS;
|
|
||||||
|
|
||||||
be = select_backend(&entry->e_nname, 0, 0);
|
|
||||||
|
|
||||||
info->size_init = get_entry_size(rs->sr_entry, 0, 0);
|
|
||||||
a_new = entry->e_attrs;
|
|
||||||
|
|
||||||
while (a_new != NULL) {
|
|
||||||
a_new_desc = a_new->a_desc;
|
|
||||||
mod = (Modifications *) malloc( sizeof(Modifications) );
|
|
||||||
mod->sml_op = LDAP_MOD_REPLACE;
|
|
||||||
ber_dupbv(&mod->sml_type, &a_new_desc->ad_cname);
|
|
||||||
|
|
||||||
for ( count = 0; a_new->a_vals[count].bv_val; count++ )
|
|
||||||
;
|
|
||||||
|
|
||||||
mod->sml_bvalues = (struct berval*) malloc(
|
|
||||||
(count+1) * sizeof( struct berval) );
|
|
||||||
|
|
||||||
mod->sml_nvalues = (struct berval*) malloc(
|
|
||||||
(count+1) * sizeof( struct berval) );
|
|
||||||
|
|
||||||
for ( i = 0; i < count; i++ ) {
|
|
||||||
ber_dupbv(mod->sml_bvalues+i, a_new->a_vals+i);
|
|
||||||
if ( a_new->a_desc->ad_type->sat_equality &&
|
|
||||||
a_new->a_desc->ad_type->sat_equality->smr_normalize ) {
|
|
||||||
rc = a_new->a_desc->ad_type->sat_equality->smr_normalize(
|
|
||||||
0,
|
|
||||||
a_new->a_desc->ad_type->sat_syntax,
|
|
||||||
a_new->a_desc->ad_type->sat_equality,
|
|
||||||
a_new->a_vals+i, mod->sml_nvalues+i, NULL );
|
|
||||||
if (rc) {
|
|
||||||
info->err = MERGE_ERR;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
ber_dupbv( mod->sml_nvalues+i, a_new->a_vals+i );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
mod->sml_bvalues[count].bv_val = 0;
|
|
||||||
mod->sml_bvalues[count].bv_len = 0;
|
|
||||||
|
|
||||||
mod->sml_nvalues[count].bv_val = 0;
|
|
||||||
mod->sml_nvalues[count].bv_len = 0;
|
|
||||||
|
|
||||||
mod->sml_desc = NULL;
|
|
||||||
slap_bv2ad(&mod->sml_type, &mod->sml_desc, &text);
|
|
||||||
mod->sml_next =NULL;
|
|
||||||
*modtail = mod;
|
|
||||||
modtail = &mod->sml_next;
|
|
||||||
a_new = a_new->a_next;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* add query UUID to queryid attribute */
|
|
||||||
mod = (Modifications *) ch_malloc( sizeof(Modifications) );
|
|
||||||
mod->sml_op = LDAP_MOD_ADD;
|
|
||||||
mod->sml_desc = slap_schema.si_ad_queryid;
|
|
||||||
ber_dupbv(&mod->sml_type, &mod->sml_desc->ad_cname);
|
|
||||||
|
|
||||||
mod->sml_bvalues = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) );
|
|
||||||
ber_dupbv( mod->sml_bvalues, uuid );
|
|
||||||
mod->sml_bvalues[1].bv_val = NULL;
|
|
||||||
mod->sml_bvalues[1].bv_len = 0;
|
|
||||||
|
|
||||||
mod->sml_nvalues = (BerVarray) ch_malloc( 2 * sizeof( struct berval ) );
|
|
||||||
ber_dupbv( mod->sml_nvalues, uuid );
|
|
||||||
mod->sml_nvalues[1].bv_val = NULL;
|
|
||||||
mod->sml_nvalues[1].bv_len = 0;
|
|
||||||
|
|
||||||
*modtail = mod;
|
|
||||||
mod->sml_next = NULL;
|
|
||||||
|
|
||||||
/* Apply changes */
|
|
||||||
op_tmp.o_req_dn = entry->e_name;
|
|
||||||
op_tmp.o_req_ndn = entry->e_nname;
|
|
||||||
op_tmp.orm_modlist = modhead;
|
|
||||||
|
|
||||||
op_tmp.o_callback->sc_response = null_response;
|
|
||||||
/* FIXME: &op_tmp ??? */
|
|
||||||
if (be->be_modify(&op_tmp, &sreply ) != 0 ) {
|
|
||||||
/* FIXME: cleanup ? */
|
|
||||||
info->err = MERGE_ERR;
|
|
||||||
goto cleanup;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* compute the size of the entry */
|
|
||||||
op_tmp.o_callback->sc_response = get_size_func;
|
|
||||||
|
|
||||||
op_tmp.ors_scope = LDAP_SCOPE_BASE;
|
|
||||||
op_tmp.ors_deref = LDAP_DEREF_NEVER;
|
|
||||||
op_tmp.ors_slimit = 1;
|
|
||||||
op_tmp.ors_tlimit = 0;
|
|
||||||
op_tmp.ors_filter = filter;
|
|
||||||
op_tmp.ors_filterstr = bv_queryid_any;
|
|
||||||
op_tmp.ors_attrs = NULL;
|
|
||||||
op_tmp.ors_attrsonly = 0;
|
|
||||||
|
|
||||||
sreply1.sr_entry = NULL;
|
|
||||||
sreply1.sr_nentries = 0;
|
|
||||||
|
|
||||||
if (be->be_search( &op_tmp, &sreply1 ) != 0) {
|
|
||||||
info->err = GET_SIZE_ERR;
|
|
||||||
}
|
|
||||||
|
|
||||||
cleanup:;
|
|
||||||
if ( modhead != NULL) {
|
|
||||||
slap_mods_free( modhead );
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
static void
|
|
||||||
add_func (
|
|
||||||
Operation *op,
|
|
||||||
SlapReply *rs
|
|
||||||
)
|
|
||||||
{
|
|
||||||
struct entry_info *info = op->o_callback->sc_private;
|
|
||||||
Entry *entry = info->entry;
|
|
||||||
struct berval *uuid = info->uuid;
|
|
||||||
Backend *be;
|
|
||||||
BerVarray value_array;
|
|
||||||
Entry *e;
|
|
||||||
Attribute *a, *attr;
|
|
||||||
int i,j;
|
|
||||||
SlapReply sreply = {REP_RESULT};
|
|
||||||
|
|
||||||
struct timeval time; /* time */
|
|
||||||
long timediff; /* time */
|
|
||||||
|
|
||||||
Operation op_tmp = *op;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* new entry, construct an entry with
|
|
||||||
* the projected attributes
|
|
||||||
*/
|
|
||||||
if (rs->sr_nentries) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
op_tmp.o_callback->sc_response = null_response;
|
|
||||||
be = select_backend(&entry->e_nname, 0, 0);
|
|
||||||
e = (Entry*)malloc(sizeof(Entry));
|
|
||||||
|
|
||||||
ber_dupbv(&e->e_name,&entry->e_name);
|
|
||||||
ber_dupbv(&e->e_nname,&entry->e_nname);
|
|
||||||
|
|
||||||
e->e_private = 0;
|
|
||||||
e->e_attrs = 0;
|
|
||||||
e->e_bv.bv_val = 0;
|
|
||||||
|
|
||||||
/* add queryid attribute */
|
|
||||||
value_array = (struct berval *)malloc(2 * sizeof( struct berval) );
|
|
||||||
ber_dupbv(value_array, uuid);
|
|
||||||
value_array[1].bv_val = NULL;
|
|
||||||
value_array[1].bv_len = 0;
|
|
||||||
|
|
||||||
a = add_attribute(slap_schema.si_ad_queryid,
|
|
||||||
e, value_array);
|
|
||||||
|
|
||||||
/* append the attribute list from the fetched entry */
|
|
||||||
a->a_next = entry->e_attrs;
|
|
||||||
entry->e_attrs = NULL;
|
|
||||||
|
|
||||||
for ( attr = e->e_attrs; attr; attr = attr->a_next ) {
|
|
||||||
if ( normalize_values( attr ) ) {
|
|
||||||
info->err = MERGE_ERR;
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
info->size_final = get_entry_size( e, 0, NULL );
|
|
||||||
|
|
||||||
op_tmp.o_bd = be;
|
|
||||||
op_tmp.ora_e = e;
|
|
||||||
|
|
||||||
if ( be->be_add( &op_tmp, &sreply ) == 0 ) {
|
|
||||||
info->added = 1;
|
|
||||||
be_entry_release_w( &op_tmp, e );
|
|
||||||
} else {
|
|
||||||
info->err = MERGE_ERR;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static Attribute*
|
static Attribute*
|
||||||
add_attribute(AttributeDescription *ad,
|
add_attribute(AttributeDescription *ad,
|
||||||
Entry* e,
|
Entry* e,
|
||||||
|
|
@ -444,25 +231,6 @@ add_attribute(AttributeDescription *ad,
|
||||||
return new_attr;
|
return new_attr;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
|
||||||
get_size_func (
|
|
||||||
Operation *op,
|
|
||||||
SlapReply *rs
|
|
||||||
)
|
|
||||||
{
|
|
||||||
struct entry_info *info = op->o_callback->sc_private;
|
|
||||||
struct exception result;
|
|
||||||
|
|
||||||
if ( rs->sr_type == REP_SEARCH ) {
|
|
||||||
result.type = info->err;
|
|
||||||
info->size_final = get_entry_size(rs->sr_entry,
|
|
||||||
info->size_init, &result);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
static int
|
static int
|
||||||
null_response (
|
null_response (
|
||||||
Operation *op,
|
Operation *op,
|
||||||
|
|
|
||||||
|
|
@ -80,7 +80,7 @@ remove_query_data (
|
||||||
op_tmp.o_callback = &cb;
|
op_tmp.o_callback = &cb;
|
||||||
op_tmp.o_time = slap_get_time();
|
op_tmp.o_time = slap_get_time();
|
||||||
op_tmp.o_do_not_cache = 1;
|
op_tmp.o_do_not_cache = 1;
|
||||||
op_tmp.o_caching_on = 1;
|
op_tmp.o_caching_on = 0;
|
||||||
|
|
||||||
op_tmp.o_req_dn = op->o_bd->be_suffix[0];
|
op_tmp.o_req_dn = op->o_bd->be_suffix[0];
|
||||||
op_tmp.o_req_ndn = op->o_bd->be_nsuffix[0];
|
op_tmp.o_req_ndn = op->o_bd->be_nsuffix[0];
|
||||||
|
|
|
||||||
|
|
@ -274,7 +274,7 @@ meta_back_cache_search(
|
||||||
int num_entries = 0;
|
int num_entries = 0;
|
||||||
int curr_limit;
|
int curr_limit;
|
||||||
int fattr_cnt=0;
|
int fattr_cnt=0;
|
||||||
|
int oc_attr_absent = 1;
|
||||||
|
|
||||||
struct exception result[1];
|
struct exception result[1];
|
||||||
|
|
||||||
|
|
@ -284,10 +284,12 @@ meta_back_cache_search(
|
||||||
cb.sc_private = op->o_bd;
|
cb.sc_private = op->o_bd;
|
||||||
|
|
||||||
if (op->ors_attrs) {
|
if (op->ors_attrs) {
|
||||||
for ( count=0; op->ors_attrs[ count ].an_name.bv_val; count++ )
|
for ( count=0; op->ors_attrs[ count ].an_name.bv_val; count++ ) {
|
||||||
;
|
if ( op->ors_attrs[count].an_desc == slap_schema.si_ad_objectClass )
|
||||||
attrs = (AttributeName*)malloc( ( count + 1 ) *
|
oc_attr_absent = 0;
|
||||||
sizeof(AttributeName));
|
}
|
||||||
|
attrs = (AttributeName*)malloc( ( count + 1 + oc_attr_absent )
|
||||||
|
*sizeof(AttributeName));
|
||||||
for ( count=0; op->ors_attrs[ count ].an_name.bv_val; count++ ) {
|
for ( count=0; op->ors_attrs[ count ].an_name.bv_val; count++ ) {
|
||||||
ber_dupbv(&attrs[ count ].an_name,
|
ber_dupbv(&attrs[ count ].an_name,
|
||||||
&op->ors_attrs[ count ].an_name);
|
&op->ors_attrs[ count ].an_name);
|
||||||
|
|
@ -297,7 +299,6 @@ meta_back_cache_search(
|
||||||
attrs[ count ].an_name.bv_len = 0;
|
attrs[ count ].an_name.bv_len = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
result->type = SUCCESS;
|
result->type = SUCCESS;
|
||||||
result->rc = 0;
|
result->rc = 0;
|
||||||
ldap_pvt_thread_mutex_lock(&cm->cache_mutex);
|
ldap_pvt_thread_mutex_lock(&cm->cache_mutex);
|
||||||
|
|
@ -364,6 +365,15 @@ meta_back_cache_search(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( attrs && oc_attr_absent ) {
|
||||||
|
for ( count = 0; attrs[count].an_name.bv_val; count++) ;
|
||||||
|
attrs[ count ].an_name.bv_val = "objectClass";
|
||||||
|
attrs[ count ].an_name.bv_len = strlen( "objectClass" );
|
||||||
|
attrs[ count ].an_desc = slap_schema.si_ad_objectClass;
|
||||||
|
attrs[ count + 1 ].an_name.bv_val = NULL;
|
||||||
|
attrs[ count + 1 ].an_name.bv_len = 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (answerable) {
|
if (answerable) {
|
||||||
Operation op_tmp;
|
Operation op_tmp;
|
||||||
|
|
||||||
|
|
@ -394,7 +404,7 @@ meta_back_cache_search(
|
||||||
op_tmp.o_req_dn = cachebase;
|
op_tmp.o_req_dn = cachebase;
|
||||||
op_tmp.o_req_ndn = ncachebase;
|
op_tmp.o_req_ndn = ncachebase;
|
||||||
|
|
||||||
op_tmp.o_caching_on = 1;
|
op_tmp.o_caching_on = 0;
|
||||||
op_tmp.o_callback = &cb;
|
op_tmp.o_callback = &cb;
|
||||||
|
|
||||||
li->glue_be->be_search(&op_tmp, rs);
|
li->glue_be->be_search(&op_tmp, rs);
|
||||||
|
|
@ -660,8 +670,7 @@ meta_back_cache_search(
|
||||||
Debug( LDAP_DEBUG_ANY, "QUERY CACHEABLE\n", 0, 0, 0 );
|
Debug( LDAP_DEBUG_ANY, "QUERY CACHEABLE\n", 0, 0, 0 );
|
||||||
#endif /* !NEW_LOGGING */
|
#endif /* !NEW_LOGGING */
|
||||||
op_tmp.o_bd = li->glue_be;
|
op_tmp.o_bd = li->glue_be;
|
||||||
uuid = cache_entries(&op_tmp, rs, entry_array,
|
uuid = cache_entries(&op_tmp, rs, entry_array, cm, result);
|
||||||
cm, result);
|
|
||||||
#ifdef NEW_LOGGING
|
#ifdef NEW_LOGGING
|
||||||
LDAP_LOG( BACK_META, DETAIL1,
|
LDAP_LOG( BACK_META, DETAIL1,
|
||||||
"Added query %s UUID %s ENTRIES %d\n",
|
"Added query %s UUID %s ENTRIES %d\n",
|
||||||
|
|
@ -681,6 +690,19 @@ meta_back_cache_search(
|
||||||
goto Catch;
|
goto Catch;
|
||||||
filter = 0;
|
filter = 0;
|
||||||
attrs = 0;
|
attrs = 0;
|
||||||
|
|
||||||
|
/* FIXME : launch do_syncrepl() threads around here
|
||||||
|
*
|
||||||
|
* entryUUID and entryCSN need also to be requested by :
|
||||||
|
*/
|
||||||
|
/*
|
||||||
|
msgid[ i ] = ldap_search( lsc->ld, mbase, realscope,
|
||||||
|
mapped_filter, mapped_attrs, op->ors_attrsonly );
|
||||||
|
*/
|
||||||
|
/* Also, mbase, realscope, mapped_filter, mapped_attrs need
|
||||||
|
* be managed as arrays. Each element needs to be retained by this point.
|
||||||
|
*/
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
#ifdef NEW_LOGGING
|
#ifdef NEW_LOGGING
|
||||||
LDAP_LOG( BACK_META, DETAIL1,
|
LDAP_LOG( BACK_META, DETAIL1,
|
||||||
|
|
@ -824,11 +846,15 @@ meta_create_entry (
|
||||||
struct berval a, mapped;
|
struct berval a, mapped;
|
||||||
Entry* ent;
|
Entry* ent;
|
||||||
BerElement ber = *e->lm_ber;
|
BerElement ber = *e->lm_ber;
|
||||||
Attribute *attr, **attrp;
|
Attribute *attr, *soc_attr, **attrp;
|
||||||
struct berval dummy = { 0, NULL };
|
struct berval dummy = { 0, NULL };
|
||||||
struct berval *bv, bdn;
|
struct berval *bv, bdn;
|
||||||
const char *text;
|
const char *text;
|
||||||
char* ename = NULL;
|
char* ename = NULL;
|
||||||
|
struct berval sc;
|
||||||
|
char* textbuf;
|
||||||
|
size_t textlen;
|
||||||
|
|
||||||
if ( ber_scanf( &ber, "{m{", &bdn ) == LBER_ERROR ) {
|
if ( ber_scanf( &ber, "{m{", &bdn ) == LBER_ERROR ) {
|
||||||
result->type = CREATE_ENTRY_ERR;
|
result->type = CREATE_ENTRY_ERR;
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
@ -930,9 +956,13 @@ meta_create_entry (
|
||||||
if ( ber_scanf( &ber, "[W]", &attr->a_vals ) == LBER_ERROR
|
if ( ber_scanf( &ber, "[W]", &attr->a_vals ) == LBER_ERROR
|
||||||
|| attr->a_vals == NULL ) {
|
|| attr->a_vals == NULL ) {
|
||||||
attr->a_vals = &dummy;
|
attr->a_vals = &dummy;
|
||||||
|
#if 0
|
||||||
} else if ( attr->a_desc == slap_schema.si_ad_objectClass ||
|
} else if ( attr->a_desc == slap_schema.si_ad_objectClass ||
|
||||||
attr->a_desc ==
|
attr->a_desc ==
|
||||||
slap_schema.si_ad_structuralObjectClass) {
|
slap_schema.si_ad_structuralObjectClass) {
|
||||||
|
#else
|
||||||
|
} else if ( attr->a_desc == slap_schema.si_ad_objectClass ) {
|
||||||
|
#endif
|
||||||
int i, last;
|
int i, last;
|
||||||
for ( last = 0; attr->a_vals[ last ].bv_val; ++last )
|
for ( last = 0; attr->a_vals[ last ].bv_val; ++last )
|
||||||
;
|
;
|
||||||
|
|
@ -953,6 +983,22 @@ meta_create_entry (
|
||||||
ber_dupbv( bv, &mapped );
|
ber_dupbv( bv, &mapped );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
structural_class( attr->a_vals, &sc, NULL, &text, textbuf, textlen );
|
||||||
|
soc_attr = (Attribute*) ch_malloc( sizeof( Attribute ));
|
||||||
|
soc_attr->a_desc = slap_schema.si_ad_structuralObjectClass;
|
||||||
|
soc_attr->a_vals = (BerVarray) ch_malloc( 2* sizeof( BerValue ));
|
||||||
|
ber_dupbv( &soc_attr->a_vals[0], &sc );
|
||||||
|
soc_attr->a_vals[1].bv_len = 0;
|
||||||
|
soc_attr->a_vals[1].bv_val = NULL;
|
||||||
|
soc_attr->a_nvals = (BerVarray) ch_malloc( 2* sizeof( BerValue ));
|
||||||
|
ber_dupbv( &soc_attr->a_nvals[0], &sc );
|
||||||
|
soc_attr->a_nvals[1].bv_len = 0;
|
||||||
|
soc_attr->a_nvals[1].bv_val = NULL;
|
||||||
|
|
||||||
|
*attrp = soc_attr;
|
||||||
|
attrp = &soc_attr->a_next;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* It is necessary to try to rewrite attributes with
|
* It is necessary to try to rewrite attributes with
|
||||||
* dn syntax because they might be used in ACLs as
|
* dn syntax because they might be used in ACLs as
|
||||||
|
|
@ -1004,6 +1050,7 @@ meta_create_entry (
|
||||||
*attrp = attr;
|
*attrp = attr;
|
||||||
attrp = &attr->a_next;
|
attrp = &attr->a_next;
|
||||||
}
|
}
|
||||||
|
|
||||||
return ent;
|
return ent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -8,6 +8,7 @@ BUILD_BDB=@BUILD_BDB@
|
||||||
BUILD_HDB=@BUILD_HDB@
|
BUILD_HDB=@BUILD_HDB@
|
||||||
BUILD_LDBM=@BUILD_LDBM@
|
BUILD_LDBM=@BUILD_LDBM@
|
||||||
BUILD_MONITOR=@BUILD_MONITOR@
|
BUILD_MONITOR=@BUILD_MONITOR@
|
||||||
|
BUILD_CACHE=@BUILD_CACHE@
|
||||||
|
|
||||||
test: tests
|
test: tests
|
||||||
tests: int-bdb
|
tests: int-bdb
|
||||||
|
|
@ -26,7 +27,7 @@ test-bdb: FORCE
|
||||||
@if test "$(BUILD_BDB)" != "no"; then \
|
@if test "$(BUILD_BDB)" != "no"; then \
|
||||||
echo "Initiating LDAP tests for BDB..." ; \
|
echo "Initiating LDAP tests for BDB..." ; \
|
||||||
$(MKDIR) test-db test-repl || true; \
|
$(MKDIR) test-db test-repl || true; \
|
||||||
$(srcdir)/scripts/all $(srcdir) bdb $(BUILD_BDB) $(BUILD_MONITOR) ; \
|
$(srcdir)/scripts/all $(srcdir) bdb $(BUILD_BDB) $(BUILD_MONITOR) $(BUILD_CACHE) ; \
|
||||||
else \
|
else \
|
||||||
echo "run configure with --enable-bdb" ; \
|
echo "run configure with --enable-bdb" ; \
|
||||||
fi
|
fi
|
||||||
|
|
@ -39,7 +40,7 @@ test-hdb: FORCE
|
||||||
@if test "$(BUILD_HDB)" != "no" ; then \
|
@if test "$(BUILD_HDB)" != "no" ; then \
|
||||||
echo "Initiating LDAP tests for HDB..." ; \
|
echo "Initiating LDAP tests for HDB..." ; \
|
||||||
$(MKDIR) test-db test-repl || true; \
|
$(MKDIR) test-db test-repl || true; \
|
||||||
$(srcdir)/scripts/all $(srcdir) hdb $(BUILD_HDB) $(BUILD_MONITOR) ; \
|
$(srcdir)/scripts/all $(srcdir) hdb $(BUILD_HDB) $(BUILD_MONITOR) $(BUILD_CACHE) ; \
|
||||||
else \
|
else \
|
||||||
echo "run configure with --enable-hdb" ; \
|
echo "run configure with --enable-hdb" ; \
|
||||||
fi
|
fi
|
||||||
|
|
@ -52,7 +53,7 @@ test-ldbm: FORCE
|
||||||
@if test "$(BUILD_LDBM)" != "no"; then \
|
@if test "$(BUILD_LDBM)" != "no"; then \
|
||||||
echo "Initiating LDAP tests for LDBM..." ; \
|
echo "Initiating LDAP tests for LDBM..." ; \
|
||||||
$(MKDIR) test-db test-repl || true; \
|
$(MKDIR) test-db test-repl || true; \
|
||||||
$(srcdir)/scripts/all $(srcdir) ldbm $(BUILD_LDBM) $(BUILD_MONITOR); \
|
$(srcdir)/scripts/all $(srcdir) ldbm $(BUILD_LDBM) $(BUILD_MONITOR) $(BUILD_CACHE); \
|
||||||
else \
|
else \
|
||||||
echo "run configure with --enable-ldbm" ; \
|
echo "run configure with --enable-ldbm" ; \
|
||||||
fi
|
fi
|
||||||
|
|
|
||||||
|
|
@ -39,8 +39,8 @@ suffix "o=University of Michigan,c=US"
|
||||||
uri ldap://127.0.0.1:9009/o=University%20of%20Michigan,c=US
|
uri ldap://127.0.0.1:9009/o=University%20of%20Michigan,c=US
|
||||||
cacheparams 10000 15000 2 @ENTRY_LIMIT@ @CACHETTL@
|
cacheparams 10000 15000 2 @ENTRY_LIMIT@ @CACHETTL@
|
||||||
|
|
||||||
attrset 0 sn cn title
|
attrset 0 sn cn title uid
|
||||||
attrset 1 mail postaladdress telephonenumber
|
attrset 1 mail postaladdress telephonenumber cn uid
|
||||||
addtemplate (|(cn=)(sn=)) 0 @CACHETTL@
|
addtemplate (|(cn=)(sn=)) 0 @CACHETTL@
|
||||||
addtemplate (sn=) 0 @CACHETTL@
|
addtemplate (sn=) 0 @CACHETTL@
|
||||||
addtemplate (uid=) 1 @CACHETTL@
|
addtemplate (uid=) 1 @CACHETTL@
|
||||||
|
|
|
||||||
|
|
@ -38,12 +38,18 @@ fi
|
||||||
|
|
||||||
SHTOOL="$SRCDIR/../build/shtool"
|
SHTOOL="$SRCDIR/../build/shtool"
|
||||||
|
|
||||||
|
if test $# -eq 0 ; then
|
||||||
|
PROXYCACHE=no
|
||||||
|
else
|
||||||
|
PROXYCACHE=$1; shift
|
||||||
|
fi
|
||||||
|
|
||||||
TB=`$SHTOOL echo -e "%B"`
|
TB=`$SHTOOL echo -e "%B"`
|
||||||
TN=`$SHTOOL echo -e "%b"`
|
TN=`$SHTOOL echo -e "%b"`
|
||||||
|
|
||||||
for CMD in $SRCDIR/scripts/test*; do
|
for CMD in $SRCDIR/scripts/test*; do
|
||||||
echo ">>>>> Starting ${TB}`basename $CMD`${TN} ..."
|
echo ">>>>> Starting ${TB}`basename $CMD`${TN} ..."
|
||||||
$CMD $SRCDIR $BACKEND $BACKENDTYPE $MONITOR
|
$CMD $SRCDIR $BACKEND $BACKENDTYPE $MONITOR $PROXYCACHE
|
||||||
RC=$?
|
RC=$?
|
||||||
if test $RC -eq 0 ; then
|
if test $RC -eq 0 ; then
|
||||||
echo ">>>>> $CMD completed ${TB}OK${TN}."
|
echo ">>>>> $CMD completed ${TB}OK${TN}."
|
||||||
|
|
|
||||||
|
|
@ -15,6 +15,11 @@ if test $# -ge 1 ; then
|
||||||
MONITORDB=$1; shift
|
MONITORDB=$1; shift
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
PROXYCACHE=no
|
||||||
|
if test $# -ge 1 ; then
|
||||||
|
PROXYCACHE=$1; shift
|
||||||
|
fi
|
||||||
|
|
||||||
WAIT=0
|
WAIT=0
|
||||||
if test $# -ge 1 ; then
|
if test $# -ge 1 ; then
|
||||||
WAIT=1; shift
|
WAIT=1; shift
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@ fi
|
||||||
|
|
||||||
. $SRCDIR/scripts/args.sh $*
|
. $SRCDIR/scripts/args.sh $*
|
||||||
|
|
||||||
if test "$BACKEND" != "ldbm"; then
|
if test $PROXYCACHE = no; then
|
||||||
echo "Test only valid for back-ldbm"
|
echo "Proxy caching requires back-meta AND (back-ldbm OR back-bdb)"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -59,7 +59,7 @@ if test $WAIT != 0 ; then
|
||||||
read foo
|
read foo
|
||||||
fi
|
fi
|
||||||
|
|
||||||
sleep 5
|
sleep 10
|
||||||
|
|
||||||
echo "Using ldapadd to populate the master directory..."
|
echo "Using ldapadd to populate the master directory..."
|
||||||
$LDAPADD -x -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
|
$LDAPADD -x -D "$MANAGERDN" -h $LOCALHOST -p $PORT -w $PASSWD < \
|
||||||
|
|
@ -93,9 +93,9 @@ if test $RC != 0 ; then
|
||||||
fi
|
fi
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
echo "Query 2: filter:(|(cn=*Jon*)(sn=Jon*)) attrs:cn sn title"
|
echo "Query 2: filter:(|(cn=*Jon*)(sn=Jon*)) attrs:cn sn title uid"
|
||||||
$LDAPSEARCH -x -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
$LDAPSEARCH -x -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
||||||
'(|(cn=*Jon*)(sn=Jon*))' cn sn title >> $SLAVEOUT 2>&1
|
'(|(cn=*Jon*)(sn=Jon*))' cn sn title uid >> $SLAVEOUT 2>&1
|
||||||
RC=$?
|
RC=$?
|
||||||
if test $RC != 0 ; then
|
if test $RC != 0 ; then
|
||||||
echo "ldapsearch failed ($RC)!"
|
echo "ldapsearch failed ($RC)!"
|
||||||
|
|
@ -104,9 +104,9 @@ if test $RC != 0 ; then
|
||||||
fi
|
fi
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
echo "Query 3: filter:(sn=Smith*) attrs:cn sn title"
|
echo "Query 3: filter:(sn=Smith*) attrs:cn sn title uid"
|
||||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
||||||
'sn=Smith*' cn sn title >> $SLAVEOUT 2>&1
|
'sn=Smith*' cn sn title uid >> $SLAVEOUT 2>&1
|
||||||
RC=$?
|
RC=$?
|
||||||
if test $RC != 0 ; then
|
if test $RC != 0 ; then
|
||||||
echo "ldapsearch failed ($RC)!"
|
echo "ldapsearch failed ($RC)!"
|
||||||
|
|
@ -115,9 +115,9 @@ if test $RC != 0 ; then
|
||||||
fi
|
fi
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
echo "Query 4: filter:(sn=Doe*) attrs:cn sn title"
|
echo "Query 4: filter:(sn=Doe*) attrs:cn sn title uid"
|
||||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
||||||
'sn=Doe' cn sn title >> $SLAVEOUT 2>&1
|
'sn=Doe' cn sn title uid >> $SLAVEOUT 2>&1
|
||||||
RC=$?
|
RC=$?
|
||||||
if test $RC != 0 ; then
|
if test $RC != 0 ; then
|
||||||
echo "ldapsearch failed ($RC)!"
|
echo "ldapsearch failed ($RC)!"
|
||||||
|
|
@ -126,9 +126,9 @@ if test $RC != 0 ; then
|
||||||
fi
|
fi
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
echo "Query 5: filter:(uid=bjorn) attrs:mail postaladdress telephonenumber"
|
echo "Query 5: filter:(uid=bjorn) attrs:mail postaladdress telephonenumber cn uid"
|
||||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
||||||
'uid=bjorn' mail postaladdress telephonenumber >> $SLAVEOUT 2>&1
|
'uid=bjorn' mail postaladdress telephonenumber cn uid >> $SLAVEOUT 2>&1
|
||||||
RC=$?
|
RC=$?
|
||||||
if test $RC != 0 ; then
|
if test $RC != 0 ; then
|
||||||
echo "ldapsearch failed ($RC)!"
|
echo "ldapsearch failed ($RC)!"
|
||||||
|
|
@ -137,9 +137,9 @@ if test $RC != 0 ; then
|
||||||
fi
|
fi
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
echo "Query 6: filter:(mail=*@example.com) cn sn title"
|
echo "Query 6: filter:(mail=*@example.com) cn sn title uid"
|
||||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
||||||
'mail=*@mail.alumni.example.com' cn sn title >> $SLAVEOUT 2>&1
|
'mail=*@mail.alumni.example.com' cn sn title uid >> $SLAVEOUT 2>&1
|
||||||
RC=$?
|
RC=$?
|
||||||
if test $RC != 0 ; then
|
if test $RC != 0 ; then
|
||||||
echo "ldapsearch failed ($RC)!"
|
echo "ldapsearch failed ($RC)!"
|
||||||
|
|
@ -148,9 +148,9 @@ if test $RC != 0 ; then
|
||||||
fi
|
fi
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
echo "Query 7: filter:(mail=*) cn sn title"
|
echo "Query 7: filter:(mail=*) cn sn title uid"
|
||||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
||||||
'mail=*' cn sn title >> $SLAVEOUT 2>&1
|
'mail=*' cn sn title uid >> $SLAVEOUT 2>&1
|
||||||
RC=$?
|
RC=$?
|
||||||
if test $RC != 0 ; then
|
if test $RC != 0 ; then
|
||||||
echo "ldapsearch failed ($RC)!"
|
echo "ldapsearch failed ($RC)!"
|
||||||
|
|
@ -182,9 +182,9 @@ else
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Query 8: filter:(|(cn=*Jones)(sn=Jones)) attrs:cn sn title"
|
echo "Query 8: filter:(|(cn=*Jones)(sn=Jones)) attrs:cn sn title uid"
|
||||||
$LDAPSEARCH -x -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
$LDAPSEARCH -x -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
||||||
'(|(cn=*Jones)(sn=Jones))' cn sn title >> $SLAVEOUT 2>&1
|
'(|(cn=*Jones)(sn=Jones))' cn sn title uid >> $SLAVEOUT 2>&1
|
||||||
RC=$?
|
RC=$?
|
||||||
if test $RC != 0 ; then
|
if test $RC != 0 ; then
|
||||||
echo "ldapsearch failed ($RC)!"
|
echo "ldapsearch failed ($RC)!"
|
||||||
|
|
@ -193,9 +193,9 @@ if test $RC != 0 ; then
|
||||||
fi
|
fi
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
echo "Query 9: filter:(sn=Smith) attrs:cn sn title"
|
echo "Query 9: filter:(sn=Smith) attrs:cn sn title uid"
|
||||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
||||||
'sn=Smith' cn sn title >> $SLAVEOUT 2>&1
|
'sn=Smith' cn sn title uid >> $SLAVEOUT 2>&1
|
||||||
RC=$?
|
RC=$?
|
||||||
if test $RC != 0 ; then
|
if test $RC != 0 ; then
|
||||||
echo "ldapsearch failed ($RC)!"
|
echo "ldapsearch failed ($RC)!"
|
||||||
|
|
@ -204,9 +204,9 @@ if test $RC != 0 ; then
|
||||||
fi
|
fi
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
echo "Query 10: filter:(uid=bjorn) attrs:mail postaladdress telephonenumber"
|
echo "Query 10: filter:(uid=bjorn) attrs:mail postaladdress telephonenumber cn uid"
|
||||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
||||||
'uid=bjorn' mail postaladdress telephonenumber >> $SLAVEOUT 2>&1
|
'uid=bjorn' mail postaladdress telephonenumber cn uid >> $SLAVEOUT 2>&1
|
||||||
RC=$?
|
RC=$?
|
||||||
if test $RC != 0 ; then
|
if test $RC != 0 ; then
|
||||||
echo "ldapsearch failed ($RC)!"
|
echo "ldapsearch failed ($RC)!"
|
||||||
|
|
@ -215,9 +215,9 @@ if test $RC != 0 ; then
|
||||||
fi
|
fi
|
||||||
sleep 3
|
sleep 3
|
||||||
|
|
||||||
echo "Query 11: filter:(mail=*@example.com) cn sn title"
|
echo "Query 11: filter:(mail=*@example.com) cn sn title uid"
|
||||||
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
$LDAPSEARCH -S "" -b "$BASEDN" -h $LOCALHOST -p $SLAVEPORT \
|
||||||
'mail=jaj@mail.alumni.example.com' cn sn title >> $SLAVEOUT 2>&1
|
'mail=jaj@mail.alumni.example.com' cn sn title uid >> $SLAVEOUT 2>&1
|
||||||
RC=$?
|
RC=$?
|
||||||
if test $RC != 0 ; then
|
if test $RC != 0 ; then
|
||||||
echo "ldapsearch failed ($RC)!"
|
echo "ldapsearch failed ($RC)!"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue