#include <ac/socket.h>
#include "slap.h"
+#include "lutil.h"
/* config block */
return(SLAP_CB_CONTINUE);
}
+static int
+translucent_tag_cb( Operation *op, SlapReply *rs )
+{
+ op->o_tag = (ber_tag_t)op->o_callback->sc_private;
+ rs->sr_tag = slap_req2res( op->o_tag );
+
+ return SLAP_CB_CONTINUE;
+}
+
/*
** translucent_modify()
** modify in local backend if exists in both;
Attribute *a, *ax;
Modifications *m, *mm;
int del, rc, erc = 0;
+ slap_callback cb = { 0 }, *save_cb;
Debug(LDAP_DEBUG_TRACE, "==> translucent_modify: %s\n",
op->o_req_dn.bv_val, 0, 0);
op->o_bd->bd_info = (BackendInfo *) on;
glue_parent(&nop);
+ save_cb = op->o_callback;
+ cb.sc_response = translucent_tag_cb;
+ cb.sc_private = (void *)LDAP_REQ_MODIFY;
+ cb.sc_next = nop.o_callback;
+ nop.o_callback = &cb;
rc = on->on_info->oi_orig->bi_op_add(&nop, &nrs);
+ nop.o_callback = save_cb;
free_attr_chain(a);
return(rc);
ov->config->debug = 0xFFFF;
rc = 0;
} else if(argc == 2) {
- ov->config->debug = atoi(argv[1]);
+ if ( lutil_atoi( &ov->config->debug, argv[1]) != 0 ) {
+ fprintf(stderr, "%s: line %d: unable to parse debug \"%s\"\n",
+ fname, lineno, argv[1]);
+ return 1;
+ }
rc = 0;
} else {
fprintf(stderr, "%s: line %d: too many arguments (%d) to debug\n",
**
*/
-int translucent_init() {
+int translucent_initialize() {
translucent.on_bi.bi_type = "translucent";
translucent.on_bi.bi_db_init = translucent_db_init;
#if SLAPD_OVER_TRANSLUCENT == SLAPD_MOD_DYNAMIC && defined(PIC)
int init_module(int argc, char *argv[]) {
- return translucent_init();
+ return translucent_initialize();
}
#endif