From: David B. <D.B...@ma...> - 2000-05-05 04:09:31
|
Howdy, Using the following code, I found that for creating users in a batch like this, I get $result->code reporting that the 'add' failed after 125 users are created. (from 126 to 150, all are reported as 'failed' even thought they are created.) Interestingly though, the users are actually added to the ldap database successfully. It also occurs when you do more than 125 deletes or any combination of adds and deletes I tried it with 100 of each, and it reported failing after 125 transactions (is that the right word?), but it does actually succeed... every time. I can probably get around it by re-binding after 125 transactions, but I don't think I should have to... Anyone feel like a bug hunt? David. ---------------------------------------------------------------------------- print "setting up LDAP connection....\n"; $ldap = Net::LDAP->new('192.168.0.10') or die "dying: $@"; $ldap->bind ( # bind to a directory with dn and password dn => 'cn=admin, o=SGCS ', password => 'mypassword' ); print "\n"; for ($i=0;$i<150;$i++){ print "attempting to create user....$i\n"; $shortusername = "testuser".$i; $result = $ldap->add ( dn => 'cn='.$shortusername.',o=SGCS', attr => [ 'cn' => $shortusername, 'givenName' => 'givennametest', 'surname' => 'Surnametest', 'fullName' => 'Fullname test', 'groupMembership' => ['cn=everyone, o=SGCS','cn=testgroup, o=SGCS'], # don't forget to also add user to group when group added to user...not like here 'mail' => $shortusername.'@test.domain.edu.au', 'objectclass' => ['top', 'person', 'organizationalPerson', 'inetOrgPerson' ], ] ); $result->code && warn "failed to add entry: ", $result->error ," ",$i; } # end of add loop -------------------------------------------------------------------- David Bussenschutt Email: D.B...@ma... Senior Computing Support Officer & Systems Administrator/Programmer Location: Griffith University. Information Technology Services Brisbane Qld. Aust. (TEN bldg. rm 1.33) Ph:(07)38757079 -------------------------------------------------------------------- |