On 10/11/05 10:35, Ronan <[EMAIL PROTECTED]> wrote: > this is the output. > > [EMAIL PROTECTED]:~$ ./ldap.pl > cn=ronan, ou=Distribution Lists, ou=Mail System, o=Queens University > Belfast, c=GB > failed to add entry: > Invalid DN syntax at ./ldap.pl line 97, <DATA> line 225. > > > the DN as you see above is correct. > Im binding as the Directory manager. > just cpan'ed 0.33 > > code follows > > use Net::LDAP; > . > . > $ldap = Net::LDAP -> new($ldap_host,port=>$ldap_port)or die "$@"; > $mesg = $ldap->bind(dn=>$bind_dn,password=>$bind_pw)or die "$@"; > . > . > > $list{'entry'} = { > 'objectClass' => ["top","mjDistributionList"], > 'cn' => ["ronan"], > 'mj_admin_passwd' => ["ronan.admin"], > 'mj_moderate' => ["TRUE"], > 'owner' => [$list_owner], > 'description' => ["aut mailing list"], > 'mj_approve_passwd' => ["aut.approve"], > 'mj_submit_policy' => ["restricted"], > 'mj_subscribe_policy' => ["closed"], > 'mj_restrict_post' => [EMAIL PROTECTED], > 'mj_DLMembers' => ["r.mcglue $ main"] > }; > > > . > . > . > > $result = $ldap->add(dn => $dn,$list{'entry'}); > if ($result != LDAP_SUCCESS){ > $result->code; > warn "failed to add entry:\n ", $result-> error; <--- this is line 97 > (from above) > } else { > print "Added $rdn successfully\n"; > }; > > > can anyone suggest why this isnt working? is there anything obvious here? > thanks > Ronan
Hi Ronan, Do any of the other attributes you're setting in the entry have a syntax of DN? For instance, 'owner' is a standard attribute with DN syntax. I guess the mj_* attribute are local definitions. You might find you need to make your DN attribute values use the DN quoting rules defined in RFC 2253, if you're constructing them from data that contains "special" characters like "=", ",", ";" and some others listed in that RFC. A look at line 225 of your input data would probably help. Cheers, Chris