On 29/8/05 8:59, Quanah Gibson-Mount <[EMAIL PROTECTED]> wrote:
>
>
> --On Monday, August 29, 2005 3:41 PM +0000 Paul <[EMAIL PROTECTED]>
> wrote:
>
>> OK, I made a slight modification and now I get:
>>
>> code: 32 msg: LDAP_NO_SUCH_OBJECT : The server cannot find an object
>> specified in the request
>> msgID : 2 DN : ou=people,ou=tsl,o=company,c=com
>>
>> Here's the code snippet:
>>
>> $ldap = Net::LDAP->new("eespvanuu1");
>> $ldap->bind("cn=Directory Manager,ou=tsl,o=company,c=com",
>> password=>'tempo123');
>>
>> $result =
>> $ldap->add("cn=ywong,uid=ywong,ou=People,ou=tsl,o=company,c=com",
>> attrs => [ 'cn' => 'ywong',
>> 'GECOS' => 'Yoko Wong',
>> 'uid' => 'ywong',
>> 'gidNumber' => '10000',
>> 'uidNumber' => '16012',
>> 'homeDirectory' => '/opt/home/ywong',
>> 'objectclass' => [ 'top', 'posixaccount',
>> 'account','shadowaccount']
>> ]
>> );
>> if ($result->code) {
>> print "code: ", $result->code;
>> print " msg: ", $result->error_name;
>> print " : ", $result->error_text;
>> print " msgID : ", $result->mesg_id;
>> print "\tDN : ", $result->dn;
>> print "\n";
>> }
>
> Did you create an ou=People subtree?
He must have, because the matched DN returned (ie the nearest ancestor
entry) was ou=People,...
> and using cn=ywong,uid=ywong looks pretty odd... most people just use
> uid=XXX...
I suspect that's the problem. Using that structure, he would need to create
an entry at uid=ywong,ou=People,... before creating the entry he describes.
One fix is to simply name the entry uid=ywong,ou=People,... Don't forget
that cn is a mandatory attribute in those objectclasses, so you must still
include a value for it.
Another is to name the entry cn=ywong+uid=ywong,ou=People,...
Cheers,
Chris