Back to index

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

Go to the source code of this file.

Functions

int ldap_parse_whoami (LDAP *ld, LDAPMessage *res, struct berval **authzid)
int ldap_whoami (LDAP *ld, LDAPControl **sctrls, LDAPControl **cctrls, int *msgidp)
int ldap_whoami_s (LDAP *ld, struct berval **authzid, LDAPControl **sctrls, LDAPControl **cctrls)

Function Documentation

int ldap_parse_whoami ( LDAP *  ld,
LDAPMessage *  res,
struct berval **  authzid 
)

Definition at line 33 of file whoami.c.

{
       int rc;
       char *retoid = NULL;

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

       *authzid = NULL;

       rc = ldap_parse_extended_result( ld, res, &retoid, authzid, 0 );

       if( rc != LDAP_SUCCESS ) {
              ldap_perror( ld, "ldap_parse_whoami" );
              return rc;
       }

       ber_memfree( retoid );
       return rc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int ldap_whoami ( LDAP *  ld,
LDAPControl **  sctrls,
LDAPControl **  cctrls,
int msgidp 
)

Definition at line 60 of file whoami.c.

{
       int rc;

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

       rc = ldap_extended_operation( ld, LDAP_EXOP_WHO_AM_I,
              NULL, sctrls, cctrls, msgidp );

       return rc;
}

Here is the call graph for this function:

Here is the caller graph for this function:

int ldap_whoami_s ( LDAP *  ld,
struct berval **  authzid,
LDAPControl **  sctrls,
LDAPControl **  cctrls 
)

Definition at line 78 of file whoami.c.

{
       int           rc;
       int           msgid;
       LDAPMessage   *res;

       rc = ldap_whoami( ld, sctrls, cctrls, &msgid );
       if ( rc != LDAP_SUCCESS ) return rc;

       if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 || !res ) {
              return ld->ld_errno;
       }

       rc = ldap_parse_whoami( ld, res, authzid );
       if( rc != LDAP_SUCCESS ) {
              ldap_msgfree( res );
              return rc;
       }

       return( ldap_result2error( ld, res, 1 ) );
}

Here is the call graph for this function:

Here is the caller graph for this function: