On 4/11/03 5:50 pm, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote: > Hello everyone, > > I am using Net::LDAP to add some entries to my LDAP directory > server(OpenLDAP 2.1.23). > When I execute the script I get the following error message: > > "The request violates the structure of the DIT". Could anyone explain what > this means and what could possibly be the cause?
It is more helpful to quote the error code rather than the text from Net::LDAP::Constant, but after a bit of grepping it appears that this text corresponds to LDAP_NAMING_VIOLATION, which is error code 64. That means that your chosen DN might have broken some sort of rules imposed by the server or server administrator. Those could be name forms ("must use attribute foo to name entries of objectclass bar"), or structure rules ("can only have entries with RDN foo subordinate to entries of RDN bar") Alternatively (simpler case!), you've goofed with your DN and the parent entry doesn't exist. I'd half expect an LDAP_NO_SUCH_OBJECT (32) error instead, but I've not looked at the specs to see if that's the right thing to return or not. Another possibility is that you didn't include all the attributes and values in the RDN in the entry itself. You are required to do this. The LDAP result message contains a "matchedDN" field which can be accessed from Net::LDAP using $res->dn(). This will contain the nearest ancestor entry that the server could locate, and might help you narrow down your problem. Cheers, Chris