/*
* Portions Copyright 1999 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include <stdio.h>
#include <string.h>
#include <stdlib.h> /* free() for Solaris */
#ifdef MACOS
#include <stdlib.h>
#else /* MACOS */
#include <malloc.h>
#include "msdos.h"
#else /* DOS */
#endif /* DOS */
#endif /* MACOS */
#include "lber.h"
#include "ldap.h"
#include "ldap-private.h"
#include "ldap-int.h"
struct ldaperror {
int e_code;
char *e_reason;
};
#ifdef SUN
LDAP_SUCCESS, 0,
/* new with ldapv3 */
LDAP_REFERRAL, 0,
/* end of new */
LDAP_IS_LEAF, 0,
LDAP_BUSY, 0,
LDAP_UNAVAILABLE, 0,
LDAP_LOOP_DETECT, 0,
/* new with ldapv3 */
/* end of new */
LDAP_OTHER, 0,
LDAP_SERVER_DOWN, 0,
LDAP_LOCAL_ERROR, 0,
LDAP_TIMEOUT, 0,
LDAP_PARAM_ERROR, 0,
LDAP_NO_MEMORY, 0,
/* new with ldapv3 */
LDAP_CLIENT_LOOP, 0,
/* end of new */
#else
LDAP_SUCCESS, "Success",
LDAP_OPERATIONS_ERROR, "Operations error",
LDAP_PROTOCOL_ERROR, "Protocol error",
LDAP_TIMELIMIT_EXCEEDED, "Timelimit exceeded",
LDAP_SIZELIMIT_EXCEEDED, "Sizelimit exceeded",
LDAP_COMPARE_FALSE, "Compare false",
LDAP_COMPARE_TRUE, "Compare true",
LDAP_AUTH_METHOD_NOT_SUPPORTED, "Authentication method not supported",
LDAP_STRONG_AUTH_REQUIRED, "Strong authentication required",
LDAP_PARTIAL_RESULTS, "Partial results and referral received",
/* new with ldapv3 */
LDAP_REFERRAL, "Referral received",
LDAP_ADMINLIMIT_EXCEEDED, "Admin. limit exceeded",
LDAP_UNAVAILABLE_CRITICAL_EXTENSION, "Unavailable critical extension",
LDAP_CONFIDENTIALITY_REQUIRED, "Confidentiality required",
/* end of new */
LDAP_NO_SUCH_ATTRIBUTE, "No such attribute",
LDAP_UNDEFINED_TYPE, "Undefined attribute type",
LDAP_INAPPROPRIATE_MATCHING, "Inappropriate matching",
LDAP_CONSTRAINT_VIOLATION, "Constraint violation",
LDAP_TYPE_OR_VALUE_EXISTS, "Type or value exists",
LDAP_INVALID_SYNTAX, "Invalid syntax",
LDAP_NO_SUCH_OBJECT, "No such object",
LDAP_ALIAS_PROBLEM, "Alias problem",
LDAP_INVALID_DN_SYNTAX, "Invalid DN syntax",
LDAP_IS_LEAF, "Object is a leaf",
LDAP_ALIAS_DEREF_PROBLEM, "Alias dereferencing problem",
LDAP_INAPPROPRIATE_AUTH, "Inappropriate authentication",
LDAP_INVALID_CREDENTIALS, "Invalid credentials",
LDAP_INSUFFICIENT_ACCESS, "Insufficient access",
LDAP_BUSY, "DSA is busy",
LDAP_UNAVAILABLE, "DSA is unavailable",
LDAP_UNWILLING_TO_PERFORM, "DSA is unwilling to perform",
LDAP_LOOP_DETECT, "Loop detected",
LDAP_NAMING_VIOLATION, "Naming violation",
LDAP_OBJECT_CLASS_VIOLATION, "Object class violation",
LDAP_NOT_ALLOWED_ON_NONLEAF, "Operation not allowed on nonleaf",
LDAP_NOT_ALLOWED_ON_RDN, "Operation not allowed on RDN",
LDAP_ALREADY_EXISTS, "Already exists",
LDAP_NO_OBJECT_CLASS_MODS, "Cannot modify object class",
LDAP_RESULTS_TOO_LARGE, "Results too large",
/* new with ldapv3 */
LDAP_AFFECTS_MULTIPLE_DSAS, "Affects multiple DSAs",
/* end of new */
LDAP_OTHER, "Unknown error",
LDAP_SERVER_DOWN, "Can't contact LDAP server",
LDAP_LOCAL_ERROR, "Local error",
LDAP_ENCODING_ERROR, "Encoding error",
LDAP_DECODING_ERROR, "Decoding error",
LDAP_TIMEOUT, "Timed out",
LDAP_AUTH_UNKNOWN, "Unknown authentication method",
LDAP_FILTER_ERROR, "Bad search filter",
LDAP_USER_CANCELLED, "User cancelled operation",
LDAP_PARAM_ERROR, "Bad parameter to an ldap routine",
LDAP_NO_MEMORY, "Out of memory",
/* new with ldapv3 */
LDAP_CONNECT_ERROR, "Connection error",
LDAP_NOT_SUPPORTED, "Not supported",
LDAP_CONTROL_NOT_FOUND, "Control not found",
LDAP_NO_RESULTS_RETURNED, "No results have been returned",
LDAP_MORE_RESULTS_TO_RETURN, "More results to return",
LDAP_CLIENT_LOOP, "Loop detected in referrals",
LDAP_REFERRAL_LIMIT_EXCEEDED, "Too many referrals followed",
/* end of new */
#endif
-1, 0
};
#ifdef SUN
#pragma init (fill_ldap_errlist)
static void fill_ldap_errlist()
{
int i=0;
/* new with ldapv3 */
/* end of new */
/* new with ldapv3 */
/* end of new */
}
#endif
char *
{
int i;
return( ldap_errlist[i].e_reason );
}
}
#ifndef NO_USERINTERFACE
void
{
int i;
perror( s );
return;
}
#ifdef SUN
/* for I18N */
} /* end if */
#endif
ldap_errlist[i].e_reason );
ld->ld_matched );
return;
}
}
(void) fprintf( stderr, catgets(slapdcat, 1, 178, "%1$s: Not an LDAP errno %2$d\n"), s, ld->ld_errno );
}
#else
void
{
}
#endif /* NO_USERINTERFACE */
int
{
int along;
int rc;
if ( r == NULLMSG )
return( LDAP_PARAM_ERROR );
; /* NULL */
}
if ( ld->ld_matched ) {
}
} else {
}
if ( rc == LBER_ERROR ) {
} else {
}
if ( freeit )
ldap_msgfree( r );
}