static char *rcsid
= "$Header: /f/osi/quipu/RCS/dsp_cache.c,v 7.2 91/02/22 09:39:16 mrose Interim $";
* $Header: /f/osi/quipu/RCS/dsp_cache.c,v 7.2 91/02/22 09:39:16 mrose Interim $
* Revision 7.2 91/02/22 09:39:16 mrose
* Revision 7.1 90/10/17 11:54:12 mrose
* Revision 7.0 89/11/23 22:17:27 mrose
* Acquisition, use, and distribution of this module and related
* materials are subject to the restrictions of a license agreement.
* Consult the Preface in the User's Manual for the full terms of
#include "quipu/common.h"
#include "quipu/dsargument.h"
extern int local_cache_size
;
extern Attr_Sequence
as_merge_aux ();
extern Entry
local_find_entry_aux();
Entry
cache_dsp_entry (ptr
)
/* assumes entry passed is complete */
extern AttributeType at_acl
;
for (asptr
= ptr
->ent_attr
; asptr
!= NULLATTR
; asptr
= asptr
->attr_link
) {
if (asptr
->attr_type
== at_acl
) {
LLOG (log_dsap
,LLOG_NOTICE
,("No ACL in dsp_cache"));
return NULLENTRY
; /* don't cache if no acl */
for (dnptr
= ptr
->ent_dn
; dnptr
->dn_parent
!= NULLDN
; dnptr
= dnptr
->dn_parent
)
if ((eptr
= local_find_entry_aux (ptr
->ent_dn
, FALSE
)) != NULLENTRY
) {
if ((eptr
->e_data
== E_TYPE_CACHE_FROM_MASTER
) ||
(eptr
->e_data
== E_TYPE_CONSTRUCTOR
)) {
as_free (eptr
->e_attributes
);
eptr
->e_attributes
= as_cpy(ptr
->ent_attr
);
eptr
->e_data
= E_TYPE_CACHE_FROM_MASTER
;
eptr
= make_path (ptr
->ent_dn
);
eptr
->e_name
= rdn_cpy (dnptr
->dn_rdn
);
eptr
->e_data
= E_TYPE_CACHE_FROM_MASTER
;
eptr
->e_attributes
= as_cpy(ptr
->ent_attr
);
if (unravel_attribute (eptr
,&error
) == NOTOK
) {
/* Keep name, but throw away attributes */
eptr
->e_data
= E_TYPE_CONSTRUCTOR
;
eptr
->e_complete
= FALSE
;
as_free (eptr
->e_attributes
);
eptr
->e_attributes
= NULLATTR
;
dsp_cache (arg
,res
,ctx
,binddn
)
Attr_Sequence as
, eis_select (), attr_eis_select ();
if (ctx
== DS_CTX_X500_DAP
)
if ((entryptr
= cache_dsp_entry (&res
->res_rd
.rdr_entry
)) != NULLENTRY
) {
/* remove acl if DAP user not allowed it */
as_free (res
->res_rd
.rdr_entry
.ent_attr
);
if ((res
->res_rd
.rdr_entry
.ent_attr
= eis_select (
arg
->arg_rd
.rda_eis
, entryptr
,
res
->res_rd
.rdr_entry
.ent_dn
)) == NULLATTR
) {
/* TODO return error nosuchattributes */
as
= res
->res_rd
.rdr_entry
.ent_attr
;
if ((res
->res_rd
.rdr_entry
.ent_attr
= attr_eis_select (
res
->res_rd
.rdr_entry
.ent_dn
)) == NULLATTR
) {
/* TODO return error nosuchattributes */
if ((arg
->arg_sr
.sra_eis
.eis_allattributes
== TRUE
) &&
(arg
->arg_sr
.sra_eis
.eis_infotypes
== EIS_ATTRIBUTESANDVALUES
)) {
for (ptr
= res
->res_sr
.CSR_entries
; ptr
!= NULLENTRYINFO
; ptr
= ptr
->ent_next
)
(void) cache_dsp_entry (ptr
);
if (ctx
== DS_CTX_QUIPU_DSP
)
cache_list (res
->res_ls
.lsr_subordinates
,
res
->res_ls
.lsr_limitproblem
,
arg
->arg_ls
.lsa_common
.ca_servicecontrol
.svc_sizelimit
);
/* the following change an entry - the easiest thing is to
deleted the cached entry and start again */
delete_cache (arg
->arg_ad
.ada_object
);
delete_cache (arg
->arg_rm
.rma_object
);
delete_cache (arg
->arg_me
.mea_object
);
delete_cache (arg
->arg_mr
.mra_object
);