From: Daniel D. <da...@li...> - 2003-03-25 20:53:23
|
Thanks to the help of Chris, I am at least now getting an error message. = =20 Can't call method "asn" on unblessed reference at=20 /usr/lib/perl5/site_perl/5.8.0/Net/LDAP.pm line 354, <STDIN> line 5. My code is nearly the same as it was in my last post: $ldap=3DNet::LDAP->new($server) or die "$@"; $ldap->bind(dn =3D> $rootdn, password =3D> $dnpassword) or die "bind"; $result=3D$ldap->search ( =09base=09=3D> "dc=3Dlife,dc=3Duiuc,dc=3Dedu", =09scope=09=3D> "sub", =09filter=09=3D> "uid=3D*", =09attrs=09=3D> "*" =09); @values =3D $result->entries; ldap code after this to find an unused uid# and gid# from above search th= is works ...other stuff not using ldap, crypting password, figuring days sin= ce=20 epoch, etc print "$dn\n"; $result=3D$ldap->add( dn =3D> [$dn], attr =3D> [ =09'uid' =3D> [$uid], =09'cn' =3D> [$geckos], =09'objectClass' =3D> ['account','posixAccount','top','shadowAccount'], =09'shadowMax' =3D> [$shadowMax], =09'shadowWarning' =3D> [$shadowWarning], =09'loginShell' =3D> [$shell], =09'uidNumber' =3D> [$id], =09'gidNumber' =3D> [$id], =09'homeDirectory' =3D> [$homedirectory], =09'geckos' =3D> [$geckos], =09'userPassword' =3D> [$password], =09'shadowLastChange' =3D> [$days] =09] =09); print "after add\n"; die "unable to add, errorcode #".$result->code() if $result->code(); It looks like it is breaking differently on the add (prints the dn but no= t=20 after add), any ideas? thanks, Dan Dan |