> Great work! Isn't it amazing what people are inspired to do when saving 20+ thousand U.S. dollars is involved? > > I also found the cache and locking system interface to > > be awkward > > Don't we all... We are hoping that someone will stare at the cache > code for long enough that she manages to document it:-) Oh, good, i'm not the only one who was/is lost! :) > Would it work just as good to simply remove the "static" keyword and > move the declarations to proto-slapd.h or back-ldbm/proto-back-ldbm.h? > Small patches are easier to review and manage than big ones. If not, a > "guide to the patch" would be nice: Which changes only move unchanged > functions around, and which ones are "real changes". I've moved the functions back and regenerated my patch without stuff moved between files. It is attached as a uuencoded or base64 text file, depending on what this STUPID mail client decides. I'd go off and use something UNIX based, but nothing useful does IMAP (pine isn't useful). I had to update tools/Makefile.in to include 4 additional objects (modify.o [which depends on repl.o [which depends on lock.o], and suffixalias.o]). > > This patch also adds support to: > > - add the new rdn attribute/value > > - delete the old rdn attribute/value if asked to do so > > - update the lastmod attributes > > - update indexes for the above > > - test the modrdn changes in the test suite > > It would be _much_ easier to review the code if you submit each change > as a separate patch. One for the bug fix, one for the new features - or > one for each new feature. Or if the fixes depend on some of the new > featuers, add the features first, of course. (And say in which order > the patches should be applied.) The bugfix and the feature addition really are tied together, although the bugfix is easy -- don't call cache_add_entry() or cache_update_entry() in modrdn. Unfortuantely, I didn't write the bugfix as several steps, so i've got nothing to go and seperate it with. > Detail: The diff is reversed. The command should be > diff {-options} old new > not diff {-options} new old > It's not a problem, since `patch' detects reversed patches, > non-reversed patches are a little easier to read. *UGH* I *NEVER* do that. Except when posting to a list, of course, it seems :( > ...oh, and send it with a mailer which doesn't break lines. > Or send it as base64 or uuencoded, so there are no lines to break. > Or put it up for FTP or HTTP and publish its URL instead. Here's a copy that's CRLF (modrdn.patch.txt) and a copy that's not (modrdn.patch).
diff -r -N -c -x Makefile openldap-1.2.0.orig/servers/slapd/back-ldbm/modify.c ldap/servers/slapd/back-ldbm/modify.c *** openldap-1.2.0.orig/servers/slapd/back-ldbm/modify.c Fri Jan 29 00:11:50 1999 --- ldap/servers/slapd/back-ldbm/modify.c Wed Feb 24 12:19:36 1999 *************** *** 11,20 **** #include "back-ldbm.h" #include "proto-back-ldbm.h" - static int add_values(Entry *e, LDAPMod *mod, char *dn); - static int delete_values(Entry *e, LDAPMod *mod, char *dn); - static int replace_values(Entry *e, LDAPMod *mod, char *dn); - int ldbm_back_modify( Backend *be, --- 11,16 ---- *************** *** 113,119 **** return( -1 ); } ! static int add_values( Entry *e, LDAPMod *mod, --- 109,115 ---- return( -1 ); } ! int add_values( Entry *e, LDAPMod *mod, *************** *** 141,147 **** return( LDAP_SUCCESS ); } ! static int delete_values( Entry *e, LDAPMod *mod, --- 137,143 ---- return( LDAP_SUCCESS ); } ! int delete_values( Entry *e, LDAPMod *mod, *************** *** 197,203 **** return( LDAP_SUCCESS ); } ! static int replace_values( Entry *e, LDAPMod *mod, --- 193,199 ---- return( LDAP_SUCCESS ); } ! int replace_values( Entry *e, LDAPMod *mod, diff -r -N -c -x Makefile openldap-1.2.0.orig/servers/slapd/back-ldbm/modrdn.c ldap/servers/slapd/back-ldbm/modrdn.c *** openldap-1.2.0.orig/servers/slapd/back-ldbm/modrdn.c Thu Feb 11 15:29:34 1999 --- ldap/servers/slapd/back-ldbm/modrdn.c Wed Feb 24 12:18:31 1999 *************** *** 8,13 **** --- 8,14 ---- #include <ac/socket.h> #include "slap.h" + #include "ldapconfig.h" #include "back-ldbm.h" #include "proto-back-ldbm.h" *************** *** 25,30 **** --- 26,38 ---- char *matched = NULL; char *p_dn = NULL, *p_ndn = NULL; char *new_dn = NULL, *new_ndn = NULL; + char *new_dn_attr = NULL, *new_dn_nattr = NULL; + char *new_dn_value = NULL, *new_dn_nvalue = NULL; + char *old_dn_value = NULL, *old_dn_nvalue = NULL; + LDAPMod *mods = NULL, *modtail = NULL, *mod; + char *temps; + int err; + struct berval bv; char sep[2]; Entry *e, *p = NULL; int rootlock = 0; *************** *** 112,118 **** new_dn = ch_strdup( newrdn ); } ! new_ndn = dn_normalize_case( ch_strdup( new_dn ) ); if ( (dn2id ( be, new_ndn ) ) != NOID ) { --- 120,126 ---- new_dn = ch_strdup( newrdn ); } ! new_ndn = dn_normalize_case( ch_strdup( new_dn ) ); if ( (dn2id ( be, new_ndn ) ) != NOID ) { *************** *** 128,133 **** --- 136,144 ---- } ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex ); + /* changing the dn2id index should probably be delayed until after + we successfully update the id2entry index with a modified entry */ + /* add new one */ if ( dn2id_add( be, new_ndn, e->e_id ) != 0 ) { send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL, NULL ); *************** *** 145,179 **** free( e->e_ndn ); e->e_dn = new_dn; e->e_ndn = new_ndn; ! (void) cache_update_entry( &li->li_cache, e ); ! /* XXX ! * At some point here we need to update the attribute values in ! * the entry itself that were effected by this RDN change ! * (respecting the value of the deleteoldrdn parameter). ! * ! * Since the code to do this has not yet been written, treat this ! * omission as a (documented) bug. ! */ /* id2entry index */ if ( id2entry_add( be, e ) != 0 ) { - entry_free( e ); send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, "", "" ); goto return_results; } ! send_ldap_result( conn, op, LDAP_SUCCESS, NULL, NULL ); rc = 0; return_results: ! if( new_dn != NULL ) free( new_dn ); ! if( new_ndn != NULL ) free( new_ndn ); ! if( p_dn != NULL ) free( p_dn ); ! if( p_ndn != NULL ) free( p_ndn ); ! ! if( matched != NULL ) free( matched ); ! if( p != NULL ) { /* free parent and writer lock */ cache_return_entry_w( &li->li_cache, p ); --- 156,320 ---- free( e->e_ndn ); e->e_dn = new_dn; e->e_ndn = new_ndn; ! ! ! /* insert a new dnattr and update the indexes ! * Delete the old dnattr if deleteoldrdn is true */ ! ! /* Get the attribute name and new value */ ! temps = ch_strdup(newrdn); ! new_dn_attr = strtok(temps,"="); ! if (new_dn_attr == NULL) ! { ! free(temps); ! Debug( LDAP_DEBUG_TRACE, "unable to locate attribute name\n", ! 0, 0, 0); ! send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR, NULL, ! "unable to find attribute name"); ! goto return_results; ! } ! new_dn_value = strtok(NULL,","); ! if (new_dn_value == NULL) ! { ! free(temps); ! Debug( LDAP_DEBUG_TRACE, "unable to locate attribute value\n", ! 0, 0, 0); ! send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR, NULL, ! "unable to find attribute value"); ! goto return_results; ! } ! new_dn_nvalue = ch_strdup(new_dn_value); ! new_dn_nattr = attr_normalize( ch_strdup(new_dn_attr) ); ! free(temps); ! ! /* setup the mods structure */ ! modtail = (LDAPMod *) ch_calloc( 1, sizeof(LDAPMod) ); ! mods = modtail; ! ! modtail->mod_op = LDAP_MOD_ADD; ! modtail->mod_type = new_dn_nattr; ! bv.bv_val = new_dn_nvalue; ! bv.bv_len = strlen(bv.bv_val); ! modtail->mod_bvalues = (struct berval **) ch_calloc( 1, ! 2 * sizeof(struct berval *) ); ! modtail->mod_bvalues[0] = ber_bvdup( &bv ); ! modtail->mod_bvalues[1] = NULL; ! ! if (deleteoldrdn) ! { ! /* get the old attribute value */ ! temps = dn_normalize_case ( ch_strdup(dn) ); ! if (strtok(temps,"=") == NULL) ! { ! free(temps); ! Debug( LDAP_DEBUG_TRACE, "unable to locate attribute name\n", ! 0, 0, 0); ! send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR, NULL, ! "unable to find attribute name"); ! goto return_results; ! } ! old_dn_value = strtok(NULL,","); ! if (new_dn_value == NULL) ! { ! free(temps); ! Debug( LDAP_DEBUG_TRACE, "unable to locate attribute value\n", ! 0, 0, 0); ! send_ldap_result( conn, op, LDAP_PROTOCOL_ERROR, NULL, ! "unable to find attribute value"); ! goto return_results; ! } ! old_dn_nvalue = ch_strdup(old_dn_value); ! free(temps); ! ! modtail->mod_next = (LDAPMod *) ch_calloc( 1, sizeof(LDAPMod) ); ! modtail = modtail->mod_next; ! modtail->mod_op = LDAP_MOD_DELETE; ! modtail->mod_type = new_dn_nattr; ! bv.bv_val = old_dn_nvalue; ! bv.bv_len = strlen(bv.bv_val); ! modtail->mod_bvalues = (struct berval **) ch_calloc( 1, ! 2 * sizeof(struct berval *) ); ! modtail->mod_bvalues[0] = ber_bvdup( &bv ); ! modtail->mod_bvalues[1] = NULL; ! } ! ! modtail->mod_next = NULL; ! ! /* update last modified fields if necessary */ ! if ( (be->be_lastmod == ON || ( be->be_lastmod == UNDEFINED && ! global_lastmod == ON ) ) && be->be_update_ndn == NULL ) { ! add_lastmods( op, &mods ); ! } ! ! if ( (err = acl_check_mods( be, conn, op, e, mods )) != LDAP_SUCCESS ) { ! send_ldap_result( conn, op, err, NULL, NULL ); ! goto return_results; ! } ! ! for ( mod = mods; mod != NULL; mod = mod->mod_next ) { ! switch ( mod->mod_op & ~LDAP_MOD_BVALUES ) { ! case LDAP_MOD_ADD: ! err = add_values( e, mod, op->o_ndn ); ! break; ! ! case LDAP_MOD_DELETE: ! err = delete_values( e, mod, op->o_ndn ); ! break; ! ! case LDAP_MOD_REPLACE: ! err = replace_values( e, mod, op->o_ndn ); ! break; ! } ! ! if ( err != LDAP_SUCCESS ) { ! /* unlock entry, delete from cache */ ! send_ldap_result( conn, op, err, NULL, NULL ); ! goto return_results; ! } ! } ! ! /* check that the entry still obeys the schema */ ! if ( global_schemacheck && oc_schema_check( e ) != 0 ) { ! Debug( LDAP_DEBUG_ANY, "entry failed schema check\n", 0, 0, 0 ); ! send_ldap_result( conn, op, LDAP_OBJECT_CLASS_VIOLATION, NULL, NULL ); ! goto return_results; ! } ! ! /* check for abandon */ ! ldap_pvt_thread_mutex_lock( &op->o_abandonmutex ); ! if ( op->o_abandon ) { ! ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex ); ! goto return_results; ! } ! ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex ); ! ! /* modify indexes */ ! if ( index_add_mods( be, mods, e->e_id ) != 0 ) { ! send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, NULL, NULL ); ! goto return_results; ! } ! /* check for abandon */ ! ldap_pvt_thread_mutex_lock( &op->o_abandonmutex ); ! if ( op->o_abandon ) { ! ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex ); ! goto return_results; ! } ! ldap_pvt_thread_mutex_unlock( &op->o_abandonmutex ); /* id2entry index */ if ( id2entry_add( be, e ) != 0 ) { send_ldap_result( conn, op, LDAP_OPERATIONS_ERROR, "", "" ); goto return_results; } ! send_ldap_result( conn, op, LDAP_SUCCESS, NULL, NULL ); rc = 0; return_results: ! /* discard the modification list */ ! modlist_free(mods); ! if( p != NULL ) { /* free parent and writer lock */ cache_return_entry_w( &li->li_cache, p ); *************** *** 186,190 **** --- 327,349 ---- /* free entry and writer lock */ cache_return_entry_w( &li->li_cache, e ); + + /* Don't add the entry back into the cache. Let the next request + for this dn update the cache. I can't quite make this work, + and the old code was broken too */ + #ifdef NEVER_USE_BROKEN_CODE + (void) cache_add_entry( &li->li_cache, e, 0 ); + #endif + + if( new_dn != NULL ) free( new_dn ); + if( new_ndn != NULL ) free( new_ndn ); + if( p_dn != NULL ) free( p_dn ); + if( p_ndn != NULL ) free( p_ndn ); + if ( new_dn_nattr != NULL) free ( new_dn_nattr ); + if ( new_dn_nvalue != NULL) free ( new_dn_nvalue ); + if ( old_dn_nvalue != NULL) free ( old_dn_nvalue ); + + if( matched != NULL ) free( matched ); + return( rc ); } diff -r -N -c -x Makefile openldap-1.2.0.orig/servers/slapd/back-ldbm/proto-back-ldbm.h ldap/servers/slapd/back-ldbm/proto-back-ldbm.h *** openldap-1.2.0.orig/servers/slapd/back-ldbm/proto-back-ldbm.h Wed Feb 10 14:36:53 1999 --- ldap/servers/slapd/back-ldbm/proto-back-ldbm.h Wed Feb 24 12:18:31 1999 *************** *** 123,128 **** --- 123,135 ---- #endif /* + * modify.c + */ + int add_values LDAP_P( (Entry *e, LDAPMod *mod, char *dn )); + int delete_values LDAP_P ((Entry *e, LDAPMod *mod, char *dn)); + int replace_values LDAP_P ((Entry *e, LDAPMod *mod, char *dn)); + + /* * nextid.c */ diff -r -N -c -x Makefile openldap-1.2.0.orig/servers/slapd/modify.c ldap/servers/slapd/modify.c *** openldap-1.2.0.orig/servers/slapd/modify.c Fri Jan 29 00:11:49 1999 --- ldap/servers/slapd/modify.c Wed Feb 24 12:14:00 1999 *************** *** 20,29 **** #include "slap.h" - static void modlist_free(LDAPMod *mods); - static void add_lastmods(Operation *op, LDAPMod **mods); - - void do_modify( Connection *conn, --- 20,25 ---- *************** *** 176,182 **** modlist_free( mods ); } ! static void modlist_free( LDAPMod *mods ) --- 172,179 ---- modlist_free( mods ); } ! /* Needed by back-ldbm/modrdn.c */ ! void modlist_free( LDAPMod *mods ) *************** *** 192,198 **** } } ! static void add_lastmods( Operation *op, LDAPMod **mods ) { char buf[22]; --- 189,196 ---- } } ! /* Needed by back-ldbm/modrdn.c */ ! void add_lastmods( Operation *op, LDAPMod **mods ) { char buf[22]; diff -r -N -c -x Makefile openldap-1.2.0.orig/servers/slapd/proto-slap.h ldap/servers/slapd/proto-slap.h *** openldap-1.2.0.orig/servers/slapd/proto-slap.h Sun Feb 7 13:42:24 1999 --- ldap/servers/slapd/proto-slap.h Wed Feb 24 12:14:02 1999 *************** *** 145,150 **** --- 145,157 ---- int lock_fclose LDAP_P(( FILE *fp, FILE *lfp )); /* + * modify.c + */ + + void add_lastmods LDAP_P((Operation *op, LDAPMod **mods)); + void modlist_free LDAP_P((LDAPMod *mods)); + + /* * monitor.c */ diff -r -N -c -x Makefile openldap-1.2.0.orig/servers/slapd/tools/Makefile.in ldap/servers/slapd/tools/Makefile.in *** openldap-1.2.0.orig/servers/slapd/tools/Makefile.in Wed Feb 3 11:48:32 1999 --- ldap/servers/slapd/tools/Makefile.in Wed Feb 24 12:33:21 1999 *************** *** 38,44 **** ../aclparse.o ../schema.o ../result.o ../filterentry.o \ ../acl.o ../phonetic.o ../attr.o ../value.o ../entry.o \ ../dn.o ../filter.o ../str2filter.o ../ava.o ../init.o \ ! ../schemaparse.o all-local: build-ldbm build-edb2ldif build-chlog2replog --- 38,45 ---- ../aclparse.o ../schema.o ../result.o ../filterentry.o \ ../acl.o ../phonetic.o ../attr.o ../value.o ../entry.o \ ../dn.o ../filter.o ../str2filter.o ../ava.o ../init.o \ ! ../schemaparse.o ../modify.o ../repl.o ../suffixalias.c \ ! ../lock.o all-local: build-ldbm build-edb2ldif build-chlog2replog diff -r -N -c -x Makefile openldap-1.2.0.orig/tests/data/modrdn.out.master ldap/tests/data/modrdn.out.master *** openldap-1.2.0.orig/tests/data/modrdn.out.master Wed Dec 31 19:00:00 1969 --- ldap/tests/data/modrdn.out.master Tue Feb 23 18:15:37 1999 *************** *** 0 **** --- 1,402 ---- + dn: cn=All Staff,ou=Groups,o=University of Michigan,c=US + member: cn=Manager, o=University of Michigan, c=US + member: cn=Barbara Jensen, ou=Information Technology Division, ou=People, o=Un + iversity of Michigan, c=US + member: cn=Jane Doe, ou=Alumni Association, ou=People, o=University of Michiga + n, c=US + member: cn=John Doe, ou=Information Technology Division, ou=People, o=Universi + ty of Michigan, c=US + member: cn=Mark Elliot, ou=Alumni Association, ou=People, o=University of Mich + igan, c=US + member: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of + Michigan, c=US + member: cn=James A Jones 2, ou=Information Technology Division, ou=People, o=U + niversity of Michigan, c=US + member: cn=Jennifer Smith, ou=Alumni Association, ou=People, o=University of M + ichigan, c=US + member: cn=Dorothy Stevens, ou=Alumni Association, ou=People, o=University of + Michigan, c=US + member: cn=Ursula Hampster, ou=Alumni Association, ou=People, o=University of + Michigan, c=US + member: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=Univ + ersity of Michigan, c=US + associateddomain: umich.edu + requeststo: cn=Manager, o=University of Michigan, c=US + errorsto: cn=Manager, o=University of Michigan, c=US + owner: cn=Manager, o=University of Michigan, c=US + cn: All Staff + joinable: FALSE + multilinedescription: Everyone in the sample data + objectclass: rfc822mailgroup + + dn: cn=Alumni Assoc Staff,ou=Groups,o=University of Michigan,c=US + member: cn=Manager, o=University of Michigan, c=US + member: cn=Dorothy Stevens, ou=Alumni Association, ou=People, o=University of + Michigan, c=US + member: cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of + Michigan, c=US + member: cn=Jane Doe, ou=Alumni Association, ou=People, o=University of Michiga + n, c=US + member: cn=Jennifer Smith, ou=Alumni Association, ou=People, o=University of M + ichigan, c=US + member: cn=Mark Elliot, ou=Alumni Association, ou=People, o=University of Mich + igan, c=US + member: cn=Ursula Hampster, ou=Alumni Association, ou=People, o=University of + Michigan, c=US + associateddomain: umich.edu + requeststo: cn=Manager, o=University of Michigan, c=US + errorsto: cn=Manager, o=University of Michigan, c=US + owner: cn=Manager, o=University of Michigan, c=US + multilinedescription: All Alumni Assoc Staff + cn: Alumni Assoc Staff + joinable: FALSE + objectclass: rfc822mailgroup + + dn: ou=Alumni Association, ou=People, o=University of Michigan, c=US + objectclass: top + objectclass: organizationalUnit + objectclass: quipuObject + objectclass: quipuNonLeafObject + ou: Alumni Association + + dn: cn=Barbara Jensen, ou=Information Technology Division, ou=People, o=Univer + sity of Michigan, c=US + objectclass: top + objectclass: person + objectclass: organizationalPerson + objectclass: newPilotPerson + objectclass: umichPerson + cn: Barbara Jensen + cn: Babs Jensen + sn: Jensen + title: Mythical Manager, Research Systems + postaladdress: ITD Prod Dev & Deployment $ 535 W. William St. Room 4212 $ Ann + Arbor, MI 48103-4943 + seealso: cn=All Staff, ou=Groups, o=University of Michigan, c=US + uid: bjensen + userpassword: bjensen + mail: bjensen@mailgw.umich.edu + homepostaladdress: 123 Wesley $ Ann Arbor, MI 48103 + krbname: bjensen@umich.edu + multilinedescription: Mythical manager of the rsdd unix project + nobatchupdates: TRUE + notice: Off sailing this month. + onvacation: FALSE + labeledurl: http://www.umich.edu/ U-M Home Page + drink: water + lastmodifiedtime: 960404035839Z + lastmodifiedby: cn=Barbara Jensen, ou=Information Technology Division, ou=Peop + le, o=University of Michigan, c=US + homephone: +1 313 555 2333 + pager: +1 313 555 3233 + facsimiletelephonenumber: +1 313 555 2274 + telephonenumber: +1 313 555 9022 + + dn: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=Universi + ty of Michigan, c=US + objectclass: top + objectclass: person + objectclass: organizationalPerson + objectclass: newPilotPerson + objectclass: umichPerson + cn: Bjorn Jensen + cn: Biiff Jensen + sn: Jensen + seealso: cn=All Staff, ou=Groups, o=University of Michigan, c=US + uid: bjorn + userpassword: bjorn + krbname: jdoe@umich.edu + nobatchupdates: TRUE + onvacation: FALSE + homepostaladdress: 19923 Seven Mile Rd. $ South Lyon, MI 49999 + drink: Iced Tea + multilinedescription: Hiker, biker + title: Director, Embedded Systems + postaladdress: Info Tech Division $ 535 W. William St. $ Ann Arbor, MI 48103 + mail: bjorn@mailgw.umich.edu + homephone: +1 313 555 5444 + pager: +1 313 555 4474 + facsimiletelephonenumber: +1 313 555 2177 + telephonenumber: +1 313 555 0355 + + dn: cn=Dorothy Stevens, ou=Alumni Association, ou=People, o=University of Mich + igan, c=US + objectclass: top + objectclass: person + objectclass: organizationalPerson + objectclass: newPilotPerson + objectclass: umichPerson + cn: Dorothy Stevens + cn: Dot Stevens + sn: Stevens + title: Secretary, UM Alumni Association + postaladdress: Alumni Association $ 111 Maple St $ Ann Arbor, MI 48109 + seealso: cn=All Staff, ou=Groups, o=University of Michigan, c=US + uid: dots + krbname: jdoe@umich.edu + nobatchupdates: TRUE + onvacation: FALSE + drink: Lemonade + homepostaladdress: 377 White St. Apt. 3 $ Ann Arbor, MI 48104 + multilinedescription: Very tall + facsimiletelephonenumber: +1 313 555 3223 + telephonenumber: +1 313 555 3664 + mail: dots@mail.alumni.umich.edu + homephone: +1 313 555 0454 + + dn: ou=Groups, o=University of Michigan, c=US + objectclass: top + objectclass: organizationalUnit + objectclass: quipuObject + objectclass: quipuNonLeafObject + ou: Groups + lastmodifiedtime: 950120182331Z + lastmodifiedby: cn=manager, o=university of michigan, c=US + + dn: ou=Information Technology Division, ou=People, o=University of Michigan, c + =US + objectclass: top + objectclass: organizationalUnit + objectclass: quipuObject + objectclass: quipuNonLeafObject + ou: Information Technology Divisio + + dn: cn=ITD Staff,ou=Groups,o=University of Michigan,c=US + associateddomain: umich.edu + requeststo: cn=Manager, o=University of Michigan, c=US + errorsto: cn=Manager, o=University of Michigan, c=US + owner: cn=Manager, o=University of Michigan, c=US + multilinedescription: All ITD Staff + cn: ITD Staff + joinable: FALSE + objectclass: rfc822mailgroup + member: cn=Manager, o=University of Michigan, c=US + member: cn=Bjorn Jensen, ou=Information Technology Division, ou=People, o=Univ + ersity of Michigan, c=US + member: cn=James A Jones 2, ou=Information Technology Division, ou=People, o=U + niversity of Michigan, c=US + member: cn=John Doe, ou=Information Technology Division, ou=People, o=Universi + ty of Michigan, c=US + labeledurl: http://www.itd.umich.edu ITD Home Page + + dn: cn=Jaj-1 NEWRDN, ou=Alumni Association, ou=People, o=University of Michiga + n, c=US + objectclass: top + objectclass: person + objectclass: organizationalPerson + objectclass: newPilotPerson + objectclass: umichPerson + cn: James A Jones 1 + cn: James Jones + cn: Jim Jones + cn: Jaj-1 NEWRDN + sn: Jones + postaladdress: Alumni Association $ 111 Maple St $ Ann Arbor, MI 48109 + seealso: cn=All Staff, ou=Groups, o=University of Michigan, c=US + uid: jaj + krbname: jaj@umich.edu + userpassword: jaj + nobatchupdates: TRUE + onvacation: FALSE + homepostaladdress: 3882 Beverly Rd. $ Ann Arbor, MI 48105 + homephone: +1 313 555 4772 + multilinedescription: Outstanding + title: Mad Cow Researcher, UM Alumni Association + pager: +1 313 555 3923 + mail: jaj@mail.alumni.umich.edu + facsimiletelephonenumber: +1 313 555 4332 + telephonenumber: +1 313 555 0895 + + dn: cn=Jaj-2 NEWRDN, ou=Information Technology Division, ou=People, o=Universi + ty of Michigan, c=US + objectclass: top + objectclass: person + objectclass: organizationalPerson + objectclass: newPilotPerson + objectclass: umichPerson + cn: James Jones + cn: Jim Jones + cn: Jaj-2 NEWRDN + sn: Doe + seealso: cn=All Staff, ou=Groups, o=University of Michigan, c=US + uid: jjones + krbname: jdoe@umich.edu + nobatchupdates: TRUE + onvacation: FALSE + homepostaladdress: 933 Brooks $ Ann Arbor, MI 48104 + homephone: +1 313 555 8838 + title: Senior Manager, Information Technology Division + multilinedescription: Not around very much + mail: jjones@mailgw.umich.edu + postaladdress: Info Tech Division $ 535 W William $ Ann Arbor, MI 48103 + pager: +1 313 555 2833 + facsimiletelephonenumber: +1 313 555 8688 + telephonenumber: +1 313 555 7334 + + dn: cn=Jane Doe, ou=Alumni Association, ou=People, o=University of Michigan, c + =US + objectclass: top + objectclass: person + objectclass: organizationalPerson + objectclass: newPilotPerson + objectclass: umichPerson + cn: Jane Doe + cn: Jane Alverson + sn: Doe + title: Programmer Analyst, UM Alumni Association + postaladdress: Alumni Association $ 111 Maple St $ Ann Arbor, MI 48109 + seealso: cn=All Staff, ou=Groups, o=University of Michigan, c=US + uid: jdoe + homepostaladdress: 123 Anystreet $ Ann Arbor, MI 48104 + krbname: jdoe@umich.edu + nobatchupdates: TRUE + onvacation: FALSE + drink: diet coke + multilinedescription: Enthusiastic + mail: jdoe@woof.net + homephone: +1 313 555 5445 + pager: +1 313 555 1220 + facsimiletelephonenumber: +1 313 555 2311 + telephonenumber: +1 313 555 4774 + + dn: cn=Jennifer Smith, ou=Alumni Association, ou=People, o=University of Michi + gan, c=US + objectclass: top + objectclass: person + objectclass: organizationalPerson + objectclass: newPilotPerson + objectclass: umichPerson + cn: Jennifer Smith + cn: Jen Smith + sn: Smith + postaladdress: Alumni Association $ 111 Maple St $ Ann Arbor, MI 48109 + seealso: cn=All Staff, ou=Groups, o=University of Michigan, c=US + uid: jen + krbname: jdoe@umich.edu + nobatchupdates: TRUE + onvacation: FALSE + drink: Sam Adams + homepostaladdress: 1000 Maple #44 $ Ann Arbor, MI 48103 + title: Telemarketer, UM Alumni Association + mail: jen@mail.alumni.umich.edu + homephone: +1 313 555 2333 + pager: +1 313 555 6442 + facsimiletelephonenumber: +1 313 555 2756 + telephonenumber: +1 313 555 8232 + + dn: cn=John Doe, ou=Information Technology Division, ou=People, o=University o + f Michigan, c=US + objectclass: top + objectclass: person + objectclass: organizationalPerson + objectclass: newPilotPerson + objectclass: umichPerson + cn: John Doe + cn: Jonathon Doe + sn: Doe + postaladdress: ITD $ 535 W. William $ Ann Arbor, MI 48109 + seealso: cn=All Staff, ou=Groups, o=University of Michigan, c=US + uid: johnd + krbname: johnd@umich.edu + nobatchupdates: TRUE + onvacation: FALSE + homepostaladdress: 912 East Bllvd $ Ann Arbor, MI 48104 + title: System Administrator, Information Technology Division + multilinedescription: overworked! + mail: johnd@mailgw.umich.edu + homephone: +1 313 555 3774 + pager: +1 313 555 6573 + facsimiletelephonenumber: +1 313 555 4544 + telephonenumber: +1 313 555 9394 + + dn: cn=Manager, o=University of Michigan, c=US + objectclass: top + objectclass: person + objectclass: quipuObject + objectclass: kerberosSecurityObject + cn: Manager + cn: Directory Manager + cn: Dir Man + sn: Manager + description: Manager of the directory + userpassword: secret + lastmodifiedtime: 951212214144Z + lastmodifiedby: cn=Manager, o=University of Michigan, c=US + krbname: bjensen@umich.edu + + dn: cn=Mark Elliot, ou=Alumni Association, ou=People, o=University of Michigan + , c=US + objectclass: top + objectclass: person + objectclass: organizationalPerson + objectclass: newPilotPerson + objectclass: umichPerson + cn: Mark Elliot + cn: Mark A Elliot + sn: Elliot + postaladdress: Alumni Association $ 111 Maple St $ Ann Arbor, MI 48109 + seealso: cn=All Staff, ou=Groups, o=University of Michigan, c=US + uid: melliot + krbname: jdoe@umich.edu + nobatchupdates: TRUE + onvacation: FALSE + homepostaladdress: 199 Outer Drive $ Ypsilanti, MI 48198 + homephone: +1 313 555 0388 + drink: Gasoline + title: Director, UM Alumni Association + mail: melliot@mail.alumni.umich.edu + pager: +1 313 555 7671 + facsimiletelephonenumber: +1 313 555 7762 + telephonenumber: +1 313 555 4177 + + dn: ou=People, o=University of Michigan, c=US + objectclass: top + objectclass: organizationalUnit + objectclass: quipuObject + objectclass: quipuNonLeafObject + ou: People + + dn: o=University of Michigan, c=US + objectclass: top + objectclass: organization + objectclass: domainRelatedObject + objectclass: quipuObject + objectclass: quipuNonLeafObject + l: Ann Arbor, Michigan + st: Michigan + streetaddress: 535 West William St. + o: University of Michigan + o: UMICH + o: UM + o: U-M + o: U of M + description: The University of Michigan at Ann Arbor + postaladdress: University of Michigan $ 535 W. William St. $ Ann Arbor, MI 481 + 09 $ USpostalcode: 48109 + telephonenumber: +1 313 764-1817 + lastmodifiedtime: 930106182800Z + lastmodifiedby: cn=manager, o=university of michigan, c=US + associateddomain: umich.edu + + dn: cn=Ursula Hampster, ou=Alumni Association, ou=People, o=University of Mich + igan, c=US + objectclass: top + objectclass: person + objectclass: organizationalPerson + objectclass: newPilotPerson + objectclass: umichPerson + cn: Ursula Hampster + sn: Hampster + title: Secretary, UM Alumni Association + postaladdress: Alumni Association $ 111 Maple St $ Ann Arbor, MI 48109 + seealso: cn=All Staff, ou=Groups, o=University of Michigan, c=US + uid: uham + homepostaladdress: 123 Anystreet $ Ann Arbor, MI 48104 + krbname: jdoe@umich.edu + nobatchupdates: TRUE + onvacation: FALSE + mail: uham@mail.alumni.umich.edu + homephone: +1 313 555 8421 + pager: +1 313 555 2844 + facsimiletelephonenumber: +1 313 555 9700 + telephonenumber: +1 313 555 5331 diff -r -N -c -x Makefile openldap-1.2.0.orig/tests/scripts/defines.sh ldap/tests/scripts/defines.sh *** openldap-1.2.0.orig/tests/scripts/defines.sh Tue Jan 19 23:44:54 1999 --- ldap/tests/scripts/defines.sh Tue Feb 23 17:10:21 1999 *************** *** 6,11 **** --- 6,12 ---- LDAPSEARCH=../clients/tools/ldapsearch LDAPMODIFY=../clients/tools/ldapmodify LDAPADD=../clients/tools/ldapadd + LDAPMODRDN=../clients/tools/ldapmodrdn LVL=5 PORT=9009 SLAVEPORT=9010 diff -r -N -c -x Makefile openldap-1.2.0.orig/tests/scripts/test005-modrdn ldap/tests/scripts/test005-modrdn *** openldap-1.2.0.orig/tests/scripts/test005-modrdn Wed Jan 13 20:02:14 1999 --- ldap/tests/scripts/test005-modrdn Tue Feb 23 18:15:07 1999 *************** *** 8,12 **** . $SRCDIR/scripts/defines.sh $SRCDIR ! echo "modrdn test not yet written" exit 0 --- 8,91 ---- . $SRCDIR/scripts/defines.sh $SRCDIR ! echo "Cleaning up in $DBDIR..." ! ! rm -f $DBDIR/[!C]* ! ! echo "Running ldif2ldbm to build slapd database..." ! $LDIF2LDBM -f $CONF -i $LDIF -e ../servers/slapd/tools ! RC=$? ! if [ $RC != 0 ]; then ! echo "ldif2ldbm failed!" ! exit $RC ! fi ! ! echo "Starting slapd on TCP/IP port $PORT..." ! $SLAPD -f $CONF -p $PORT -d $LVL > $MASTERLOG 2>&1 & ! PID=$! ! ! echo "Testing slapd modrdn operations..." ! for i in 0 1 2 3 4 5; do ! $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \ ! 'cn=Manager' > /dev/null 2>&1 ! RC=$? ! if [ $RC = 1 ]; then ! echo "Waiting 5 seconds for slapd to start..." ! sleep 5 ! fi ! done ! ! if [ $RC != 0 ]; then ! echo "ldapsearch failed!" ! kill -HUP $PID ! exit $RC ! fi ! ! cat /dev/null > $TESTOUT ! ! echo "Testing modrdn (deleteoldrdn=0)..." ! $LDAPMODRDN -v -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD \ ! "cn=James A Jones 1, ou=Alumni Association, ou=People, o=University of Michigan, c=US" \ ! "cn=Jaj-1 NEWRDN" \ ! > /dev/null 2>&1 ! RC=$? ! if [ $RC != 0 ]; then ! echo "ldapmodrdn failed!" ! kill -HUP $PID ! exit $RC ! fi ! ! echo "Testing modrdn (deleteoldrdn=1)..." ! $LDAPMODRDN -r -v -D "$MANAGERDN" -h localhost -p $PORT -w $PASSWD \ ! "cn=James A Jones 2, ou=Information Technology Division, ou=People, o=University of Michigan, c=US" \ ! "cn=Jaj-2 NEWRDN" \ ! > /dev/null 2>&1 ! RC=$? ! if [ $RC != 0 ]; then ! echo "ldapmodrdn failed!" ! kill -HUP $PID ! exit $RC ! fi ! ! echo "Using ldapsearch to retrieve all entries..." ! $LDAPSEARCH -L -S "" -b "$BASEDN" -h localhost -p $PORT \ ! 'objectClass=*' | egrep -iv '^createtimestamp:|^modifytimestamp:|^modifiersname:' \ ! > $SEARCHOUT 2>&1 ! RC=$? ! kill -HUP $PID ! if [ $RC != 0 ]; then ! echo "ldapsearch failed!" ! exit $RC ! fi ! ! echo "Comparing database to reference file" ! cmp $SEARCHOUT $MODRDNOUTMASTER ! if [ $? != 0 ]; then ! echo "comparison failed - modify operations did not complete correctly" ! exit 1 ! fi ! ! echo ">>>>> Test succeeded" ! ! exit 0
Attachment:
modrdn.patch
Description: Binary data