ldap_add_s

Synchronously adds an entry to the directory.

LDAP Version: v2 or higher
Library:*ldapsdk.*
NDS Version:7.xx or higher
Platform:NLM, Windows (NT, 95, 98, 2000, XP, Vista 32-bit and 64-bit ), Linux (32-bit and 64-bit), Solaris, AIX, and HP-UX

Syntax

  #include <ldap.h>
  
  int ldap_add_s (
     LDAP         *ld,
     const char   *dn,
     LDAPMod     **attrs);
  
  

Parameters

ld

(IN) Points to the handle for the LDAP session.

dn

(IN) Points to the distinguished name of the entry to add, for example: "o=novell", "ou=provo", "cn=kim"

All components of the dn must exist except for the leaf component. The leaf component name must be unique within the container.

attrs

(IN) Points to an array of LDAPMod structures that contain the attributes and values to add with the entry. All mandatory attributes must have values or the operation fails.

Return Values

0x00

LDAP_SUCCESS

Non-zero

Failure. For a complete list, see LDAP Return Codes.

0x53

LDAP_ENCODING_ERROR

0x5A

LDAP_NO_MEMORY

Remarks

The ldap_add_s is an older function. LDAP v3 clients should use the ldap_add_ext_s function.

For a list of mandatory attributes for an entry see the LDAP server's schema. For eDirectory, see NDK: Novell eDirectory Schema Reference.

See Also

ldap_add, ldap_add_ext, ldap_add_ext_s, ldap_modify