X-Git-Url: https://git.sur5r.net/?a=blobdiff_plain;f=libraries%2Flibldap%2Fwhoami.c;h=4dac856a0fe7add26e68cc05fbbab3778c4657d9;hb=1d841e47c877842433dc11aaec9da36191fed960;hp=f44e1d2caf1c8613bc13ef81c1c6405f9f6d91db;hpb=159de0f1359459371c590ac770cc30edbade58d5;p=openldap
diff --git a/libraries/libldap/whoami.c b/libraries/libldap/whoami.c
index f44e1d2caf..4dac856a0f 100644
--- a/libraries/libldap/whoami.c
+++ b/libraries/libldap/whoami.c
@@ -1,7 +1,7 @@
/* $OpenLDAP$ */
/* This work is part of OpenLDAP Software .
*
- * Copyright 1998-2003 The OpenLDAP Foundation.
+ * Copyright 1998-2008 The OpenLDAP Foundation.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -12,6 +12,10 @@
* top-level directory of the distribution or, alternatively, at
* .
*/
+/* ACKNOWLEDGEMENTS:
+ * This program was orignally developed by Kurt D. Zeilenga for inclusion in
+ * OpenLDAP Software.
+ */
#include "portable.h"
@@ -64,7 +68,7 @@ ldap_whoami( LDAP *ld,
assert( LDAP_VALID( ld ) );
assert( msgidp != NULL );
- rc = ldap_extended_operation( ld, LDAP_EXOP_X_WHO_AM_I,
+ rc = ldap_extended_operation( ld, LDAP_EXOP_WHO_AM_I,
NULL, sctrls, cctrls, msgidp );
return rc;
@@ -84,7 +88,7 @@ ldap_whoami_s(
rc = ldap_whoami( ld, sctrls, cctrls, &msgid );
if ( rc != LDAP_SUCCESS ) return rc;
- if ( ldap_result( ld, msgid, 1, (struct timeval *) NULL, &res ) == -1 ) {
+ if ( ldap_result( ld, msgid, LDAP_MSG_ALL, (struct timeval *) NULL, &res ) == -1 || !res ) {
return ld->ld_errno;
}