Back to index

openldap  2.4.31
Functions
sbind.c File Reference
#include "portable.h"
#include <stdio.h>
#include <ac/socket.h>
#include <ac/string.h>
#include <ac/time.h>
#include "ldap-int.h"

Go to the source code of this file.

Functions

int ldap_simple_bind (LDAP *ld, LDAP_CONST char *dn, LDAP_CONST char *passwd)
int ldap_simple_bind_s (LDAP *ld, LDAP_CONST char *dn, LDAP_CONST char *passwd)

Function Documentation

int ldap_simple_bind ( LDAP *  ld,
LDAP_CONST char *  dn,
LDAP_CONST char *  passwd 
)

Definition at line 59 of file sbind.c.

{
       int rc;
       int msgid;
       struct berval cred;

       Debug( LDAP_DEBUG_TRACE, "ldap_simple_bind\n", 0, 0, 0 );

       assert( ld != NULL );
       assert( LDAP_VALID( ld ) );

       if ( passwd != NULL ) {
              cred.bv_val = (char *) passwd;
              cred.bv_len = strlen( passwd );
       } else {
              cred.bv_val = "";
              cred.bv_len = 0;
       }

       rc = ldap_sasl_bind( ld, dn, LDAP_SASL_SIMPLE, &cred,
              NULL, NULL, &msgid );

       return rc == LDAP_SUCCESS ? msgid : -1;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int ldap_simple_bind_s ( LDAP *  ld,
LDAP_CONST char *  dn,
LDAP_CONST char *  passwd 
)

Definition at line 99 of file sbind.c.

{
       struct berval cred;

       Debug( LDAP_DEBUG_TRACE, "ldap_simple_bind_s\n", 0, 0, 0 );

       if ( passwd != NULL ) {
              cred.bv_val = (char *) passwd;
              cred.bv_len = strlen( passwd );
       } else {
              cred.bv_val = "";
              cred.bv_len = 0;
       }

       return ldap_sasl_bind_s( ld, dn, LDAP_SASL_SIMPLE, &cred,
              NULL, NULL, NULL );
}

Here is the call graph for this function:

Here is the caller graph for this function: