]> git.sur5r.net Git - openldap/blobdiff - libraries/libldap/error.c
Added support for BDB 4.1.17
[openldap] / libraries / libldap / error.c
index 0e7721a21aac290afe71cc8ccc042c833c11ad1f..45f9eec86e4a8542766b7064a11d6c324ea5ce90 100644 (file)
@@ -1,6 +1,6 @@
 /* $OpenLDAP$ */
 /*
- * Copyright 1998-2000 The OpenLDAP Foundation, All Rights Reserved.
+ * Copyright 1998-2002 The OpenLDAP Foundation, All Rights Reserved.
  * COPYING RESTRICTIONS APPLY, see COPYRIGHT file
  */
 
@@ -30,13 +30,13 @@ static struct ldaperror ldap_builtin_errlist[] = {
        {LDAP_COMPARE_FALSE,                    "Compare False" },
        {LDAP_COMPARE_TRUE,                     "Compare True" },
        {LDAP_STRONG_AUTH_NOT_SUPPORTED, "Authentication method not supported" },
-       {LDAP_STRONG_AUTH_REQUIRED,     "Strong authentication required" },
+       {LDAP_STRONG_AUTH_REQUIRED,     "Strong(er) authentication required" },
        {LDAP_PARTIAL_RESULTS,                  "Partial results and referral received" },
 
        {LDAP_REFERRAL,                                 "Referral"},
        {LDAP_ADMINLIMIT_EXCEEDED,              "Administrative limit exceeded"},
        {LDAP_UNAVAILABLE_CRITICAL_EXTENSION,
-                                                                       "Criticial extension is unavailable"},
+                                                                       "Critical extension is unavailable"},
        {LDAP_CONFIDENTIALITY_REQUIRED, "Confidentiality required"},
        {LDAP_SASL_BIND_IN_PROGRESS,    "SASL bind in progress"},
 
@@ -56,21 +56,21 @@ static struct ldaperror ldap_builtin_errlist[] = {
        {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_BUSY,                                     "Server is busy" },
+       {LDAP_UNAVAILABLE,                              "Server is unavailable" },
+       {LDAP_UNWILLING_TO_PERFORM,     "Server 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_NONLEAF,   "Operation not allowed on non-leaf" },
        {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" },
        {LDAP_AFFECTS_MULTIPLE_DSAS,    "Operation affects multiple DSAs" },
 
-       {LDAP_OTHER,                                    "Unknown error" },
+       {LDAP_OTHER,                                    "Internal (implementation specific) error" },
 
        /* API ResultCodes */
        {LDAP_SERVER_DOWN,                              "Can't contact LDAP server" },
@@ -146,7 +146,11 @@ ldap_err2string( int err )
 {
        const struct ldaperror *e;
        
+#ifdef NEW_LOGGING
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_err2string\n", 0,0,0 );
+#else
        Debug( LDAP_DEBUG_TRACE, "ldap_err2string\n", 0, 0, 0 );
+#endif
 
        e = ldap_int_error( err );
 
@@ -158,17 +162,16 @@ void
 ldap_perror( LDAP *ld, LDAP_CONST char *str )
 {
        const struct ldaperror *e;
+#ifdef NEW_LOGGING
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_perror\n", 0,0,0 );
+#else
        Debug( LDAP_DEBUG_TRACE, "ldap_perror\n", 0, 0, 0 );
+#endif
 
        assert( ld != NULL );
        assert( LDAP_VALID( ld ) );
        assert( str );
 
-       if ( ld == NULL ) {
-               fprintf( stderr, "ldap_perror: invalid session handle\n" );
-               return;
-       }
-
        e = ldap_int_error( ld->ld_errno );
 
        fprintf( stderr, "%s: %s (%d)\n",
@@ -239,16 +242,16 @@ ldap_parse_result(
        ber_tag_t tag;
        BerElement      *ber;
 
+#ifdef NEW_LOGGING
+       LDAP_LOG ( OPERATION, ENTRY, "ldap_parse_result\n", 0,0,0 );
+#else
        Debug( LDAP_DEBUG_TRACE, "ldap_parse_result\n", 0, 0, 0 );
+#endif
 
        assert( ld != NULL );
        assert( LDAP_VALID( ld ) );
        assert( r != NULL );
 
-       if ( ld == NULL || r == NULL ) {
-               return LDAP_PARAM_ERROR;
-       }
-
        if(errcodep != NULL) *errcodep = LDAP_SUCCESS;
        if(matcheddnp != NULL) *matcheddnp = NULL;
        if(errmsgp != NULL) *errmsgp = NULL;