Used only for simple bind when dn == NULL and password != NULL.
The name of the option is the as listed but with a prefix of \fBLDAP\fP.
For example, to define \fBBASE\fP via the environment, define the variable
\fBLDAPBASE\fP to desired value.
+.LP
+Some options are user\-only. Such options are ignored if present
+in the
+.IR ldap.conf
+(or file specified by
+.BR LDAPCONF ).
.SH OPTIONS
The different configuration options are:
.TP 1i
\fBBASE <base>\fP
-Used to specify the default base dn to use when performing ldap operations.
+Used to specify the default base DN to use when performing ldap operations.
The base must be specified as a Distinguished Name in LDAP format.
.TP 1i
+\fBBINDDN <dn>\fP
+Used to specify the default bind DN to use when performing ldap operations.
+The bind DN must be specified as a Distinguished Name in LDAP format.
+This is a user\-only option.
+.TP 1i
\fBHOST <name[:port] ...>\fP
Used to specify the name(s) of an LDAP server(s) to which
.I ldap
offsetof(struct ldapoptions, ldo_sizelimit)},
{0, ATTR_INT, "TIMELIMIT", NULL,
offsetof(struct ldapoptions, ldo_timelimit)},
+ {1, ATTR_STRING, "BINDDN", NULL,
+ offsetof(struct ldapoptions, ldo_defbinddn)},
{0, ATTR_STRING, "BASE", NULL,
offsetof(struct ldapoptions, ldo_defbase)},
{0, ATTR_INT, "PORT", NULL,
LDAPURLDesc *ldo_defludp;
int ldo_defport;
char* ldo_defbase;
+ char* ldo_defbinddn; /* simple bind dn */
#ifdef LDAP_CONNECTIONLESS
int ldo_cldaptries; /* connectionless search retry count */
#define ld_timelimit ld_options.ldo_timelimit
#define ld_sizelimit ld_options.ldo_sizelimit
+#define ld_defbinddn ld_options.ldo_defbinddn
#define ld_defbase ld_options.ldo_defbase
#define ld_defhost ld_options.ldo_defhost
#define ld_defport ld_options.ldo_defport
return ld->ld_errno;
}
- if( mechanism != LDAP_SASL_SIMPLE
- && ld->ld_version < LDAP_VERSION3)
- {
+ if( mechanism == LDAP_SASL_SIMPLE ) {
+ if( dn == NULL && cred != NULL ) {
+ /* use default binddn */
+ dn = ld->ld_defbinddn;
+ }
+
+ } else if( ld->ld_version < LDAP_VERSION3 ) {
ld->ld_errno = LDAP_NOT_SUPPORTED;
return ld->ld_errno;
}
- if ( dn == NULL )
+ if ( dn == NULL ) {
dn = "";
+ }
/* create a message to send */
if ( (ber = ldap_alloc_ber_with_options( ld )) == NULL ) {