From: Daniel D. <da...@li...> - 2003-03-25 18:17:31
|
I am trying to add a record, and my script keeps hanging when I actually = go to=20 do the add. First the code snipet, I am only including the lines pertain= ing=20 to ldap. #get a uid and gid that isnt used $ldap=3DNet::LDAP->new($server) or die "$@"; $ldap->bind(dn =3D> $rootdn, password =3D> $dnpassword) or die "bind"; $result=3D$ldap->search ( base =3D> "dc=3Dlife,dc=3Duiuc,dc=3Dedu", scope =3D> "sub", filter =3D> "uid=3D*", attrs =3D> "*" ); ldap code after this to find an unused uid# and gid# from above search th= is=20 works =2E..other stuff not using ldap, crypting password, figuring days since e= poch,=20 etc $dn=3D"uid=3D$uid,$dnsuffix"; $homedirectory=3D"$homeprefix$uid"; print "$dn\n"; $res=3D$ldap->add( dn =3D> $dn, attr =3D> [ 'uid' =3D> $uid, 'cn' =3D> $geckos, 'objectClass' =3D> ['account','posixAccount','top','shadowAccount= '], 'shadowMax' =3D> $shadowMax, 'shadowWarning' =3D> $shadowWarning, 'loginShell' =3D> $shell, 'uidNumber' =3D> $id, 'gidNumber' =3D> $id, 'homeDirectory' =3D> $homedirectory, 'geckos' =3D> $geckos, 'userPassword' =3D> $password, 'shadowLastChange' =3D> $days ] ); die "unable to add, errorcode #".$res->code() if $res->code(); It will print the dn as it should, then afterward, the script hangs on tr= ying=20 to do the add and will not do anything, so it cannot even get to my error= =20 checking line, the only way out is to control c. If need be, I can attac= h a=20 full copy of my code if it would be helpful for someone to see it. Dan |