ldap_default_dn_get()-- Retrieve the User's Default DN


  Syntax
 #include <ldap.h>
 
 int ldap_default_dn_get(
       char           **default_dn,
       char           *filename)

  Default Public Authority: *USE

  Library Name/Service Program: QSYS/QGLDCLNT

  Threadsafe: Yes

The ldap_default_dn_get() API is used to retrieve the user's default DN. To free the returned string, use ldap_memfree().

An application stores the default DN on disk by calling ldap_default_dn_set(). For IBM® i, the default file (used when filename is NULL) where the default DN stored is called ldap_user_info and will be found in the user's home directory. A user's home directory is specified in the user's profile.


Authorities and Locks

The caller must have Execute (*X) authority to each directory in the path name preceding the name of the user information file. The caller must have Read (*R) authority to the user information file.


Parameters

default_dn
(output) Specifies the user's default Distinguished Name. Free *default_dn with ldap_memfree() when no longer needed.
filename
(Input) Specifies an alternative location for the user's default Distinguished Name storage. If only a filename is given for the filename parameter then the file will be checked in the current directory, otherwise, if a path is given as well as a filename as part of the filename parameter, the file will be checked following the given path. If filename is NULL, a file called ldap_user_info in the user's home directory will be read.

Return Value

LDAP_SUCCESS
if the default DN was retrieved.

another LDAP error code
if the request was not successful.

Error Conditions

The ldap_default_dn_get() API will return an LDAP error code if not successful. See LDAP Client API Error Conditions for possible LDAP error code values.


Error Messages

The following message may be sent from this function.

Message ID Error Message Text
CPF3CF2 E Error(s) occurred during running of ldap_default_dn_get API.

Related Information



API introduced: V4R5

[ Back to top | LDAP APIs | APIs by category ]