Masato Taruishi
taru****@users*****
2004年 10月 31日 (日) 14:52:00 JST
=================================================================== RCS file: plugin/slapd/upstream/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- plugin/slapd/upstream/Makefile.am 2004/10/26 11:02:07 1.6 +++ plugin/slapd/upstream/Makefile.am 2004/10/31 05:52:00 1.7 @@ -1,6 +1,8 @@ OPENLDAP_VERSION := 2.2.18 +PATCHES := syncbackup-$(OPENLDAP_VERSION).patch slapd.conf-$(OPENLDAP_VERSION).patch + include ../ultrapossum.am all-local: build-upstream @@ -9,7 +11,11 @@ $(MAKE) -C build-tree/openldap-$(OPENLDAP_VERSION) build-tree/openldap-$(OPENLDAP_VERSION)/config.status: - install -d build-tree && cd build-tree && tar zxf ../openldap-$(OPENLDAP_VERSION).tgz && cd openldap-$(OPENLDAP_VERSION) && patch -p1 < ../../syncbackup-$(OPENLDAP_VERSION).patch && patch -p1 < ../../slapd.conf-$(OPENLDAP_VERSION).patch && chmod 755 tests/scripts/test101-syncbackup && ./configure --prefix=${moduledir}/slapd --sysconfdir=${sysconfdir}/ultrapossum/slapd --localstatedir=${localstatedir}/lib/ultrapossum/slapd/ + install -d build-tree + cd build-tree && tar zxf ../openldap-$(OPENLDAP_VERSION).tgz + cd build-tree/openldap-$(OPENLDAP_VERSION) && for f in $(PATCHES); do patch -p1 < ../../$$f; done + chmod 755 build-tree/openldap-$(OPENLDAP_VERSION)/tests/scripts/test101-syncbackup + cd build-tree/openldap-$(OPENLDAP_VERSION) && ./configure --prefix=${moduledir}/slapd --sysconfdir=${sysconfdir}/ultrapossum/slapd --localstatedir=${localstatedir}/lib/ultrapossum/slapd/ --without-threads check-local: $(MAKE) -C build-tree/openldap-$(OPENLDAP_VERSION) test =================================================================== RCS file: plugin/slapd/upstream/syncbackup-2.2.18.patch,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- plugin/slapd/upstream/syncbackup-2.2.18.patch 2004/10/26 11:02:08 1.1 +++ plugin/slapd/upstream/syncbackup-2.2.18.patch 2004/10/31 05:52:00 1.2 @@ -2,16 +2,16 @@ =================================================================== RCS file: /cvsroot/openldap-ha/build-tree/openldap-2.2.18/build/version.var,v retrieving revision 1.1.1.1 -retrieving revision 1.2 -diff -u -r1.1.1.1 -r1.2 +retrieving revision 1.3 +diff -u -r1.1.1.1 -r1.3 --- openldap-2.2.18/build/version.var 26 Oct 2004 10:14:56 -0000 1.1.1.1 -+++ openldap-2.2.18/build/version.var 26 Oct 2004 10:26:04 -0000 1.2 ++++ openldap-2.2.18/build/version.var 31 Oct 2004 05:05:58 -0000 1.3 @@ -15,7 +15,7 @@ ol_package=OpenLDAP ol_major=2 ol_minor=2 -ol_patch=18 -+ol_patch=18sb1 ++ol_patch=18sb2 ol_api_inc=20218 ol_api_current=7 ol_api_revision=11 @@ -817,21 +817,26 @@ =================================================================== RCS file: /cvsroot/openldap-ha/build-tree/openldap-2.2.18/servers/slapd/connection.c,v retrieving revision 1.1.1.1 -retrieving revision 1.2 -diff -u -r1.1.1.1 -r1.2 +retrieving revision 1.3 +diff -u -r1.1.1.1 -r1.3 --- openldap-2.2.18/servers/slapd/connection.c 26 Oct 2004 10:15:06 -0000 1.1.1.1 -+++ openldap-2.2.18/servers/slapd/connection.c 26 Oct 2004 10:26:09 -0000 1.2 -@@ -1164,6 +1164,14 @@ ++++ openldap-2.2.18/servers/slapd/connection.c 30 Oct 2004 19:20:19 -0000 1.3 +@@ -1164,6 +1164,19 @@ conn->c_n_ops_executing--; conn->c_n_ops_completed++; +#ifdef LDAP_SYNCBACKUP + } else if ( ( op->o_tag == LDAP_REQ_EXTENDED && !strcmp(op->oq_extended.rs_reqoid.bv_val, LDAP_EXOP_X_START_SYNC)) ) { -+ sl_mem_detach( ctx, memctx ); + LDAP_STAILQ_REMOVE( &conn->c_ops, op, slap_op, o_next); + LDAP_STAILQ_NEXT(op, o_next) = NULL; + conn->c_n_ops_executing--; + conn->c_n_ops_completed++; ++ fprintf(stderr, "startsync: %d\n", rc ); ++ if( rc == SLAPD_ABANDON ) { ++ sl_mem_detach( ctx, memctx ); ++ } else { ++ slap_op_free( op ); ++ } +#endif } else { LDAP_STAILQ_REMOVE( &conn->c_ops, op, slap_op, o_next); @@ -1393,8 +1398,8 @@ RCS file: openldap-2.2.18/servers/slapd/startsync.c diff -N openldap-2.2.18/servers/slapd/startsync.c --- /dev/null 1 Jan 1970 00:00:00 -0000 -+++ openldap-2.2.18/servers/slapd/startsync.c 26 Oct 2004 10:27:57 -0000 1.1 -@@ -0,0 +1,323 @@ ++++ openldap-2.2.18/servers/slapd/startsync.c 30 Oct 2004 19:20:19 -0000 1.2 +@@ -0,0 +1,345 @@ +/* $OpenLDAP:$ */ +/* + * startSYNC extended operation @@ -1452,6 +1457,7 @@ +{ + Operation *op = bak->op; + SlapReply rs = { REP_EXTENDED }; ++ void *saved_tmpmemctx = NULL; + + if ( op->o_abandon != 1 ) + { @@ -1477,8 +1483,16 @@ + + } + ++ if ( op->o_tmpmemctx ) { ++ saved_tmpmemctx = op->o_tmpmemctx; ++ } ++ + slap_op_free( op ); + ++ if ( saved_tmpmemctx ) { ++ sl_mem_destroy( NULL, saved_tmpmemctx ); ++ } ++ + return 0; + +} @@ -1493,6 +1507,7 @@ + char *syncid; + struct berval cookie = { 0, NULL }; + BackendDB *bd; ++ void *memctx_null = NULL; + +#ifdef NEW_LOGGING + LDAP_LOG( OPERATION, DETAIL1, "=>startsync\n", 0, 0, 0 ); @@ -1500,6 +1515,14 @@ + Debug( LDAP_DEBUG_TRACE, "=>startsync\n", 0, 0, 0 ); +#endif + ++ ++ if ( op->o_tmpmemctx ) { ++ op->o_savmemctx = op->o_tmpmemctx; ++ op->o_tmpmemctx = NULL; ++ op->o_tmpmfuncs = &ch_mfuncs; ++ ber_set_option( op->o_ber, LBER_OPT_BER_MEMCTX, &memctx_null ); ++ } ++ + rs->sr_rspoid = ch_strdup(LDAP_EXOP_X_START_SYNC); + + if (rs->sr_rspoid == NULL) { @@ -1622,6 +1645,10 @@ + rs->sr_err = LDAP_SUCCESS; + send_ldap_intermediate( op, rs ); + ++ /* ++ * FIXME: ad-hoc return value to make this operation ++ * persistent. ++ */ + rc = SLAPD_ABANDON; + + break;