From: Bing D. <Bi...@ci...> - 2001-02-23 15:15:34
|
I have the following two lines in the ldif. Ldapmodify command can modify the first entry without any problem. But gives 'constraint violation' on the second one. Do I have to split them into two ldif's? ==== dn: uid=111,ou=dept-1,dc=tamu,dc=edu changetype: modrdn newrdn: uid=222 deleteoldrdn: 1 dn: uid=111,ou=dept-2,dc=tamu,dc=edu changetype: modrdn newrdn: uid=222 deleteoldrdn: 1 ===== Any ideas? Thanks, Bing Bing Du <bi...@ta..., 979-845-9577> Texas A&M University, CIS, Operating Systems, Unix >>> Andrew Tristan <atr...@ac...> 02/22/01 10:36PM >>> Actually I solved the problem just as I was getting ready to send this. On the off chance that this will help someone else, here it is. > I *know* I had this working at some point (at least, I thought I had). > I'm getting "LDAP_NO_SUCH_ATTRIBUTE" when I call moddn() like so, > my $moddnResult = $ldap->moddn( > $ldapDN, > newrdn => "cid=$ldifCID", > deleteoldrdn => '1', > newsuperior => "$personDN", > ); > > I get the same result whether the first arg is a dn or an entry > object. This is with v0.22, perl 5.005something, and openldap > 1.2.something. There were problems with moddn a while ago, I know, > but I'm almost positive that I had this working at some point after > that. I'm sure I'm doing something obviously wrong, any takers? > It's always so obvious in retrospect (though I didn't provide enough info above to solve it): I was calling modify() to manually set the cid attribute (our rdn) before I called moddn(). And then it all makes sense... A -- and...@uc... Unix Systems Group, UC Riverside |