apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bnicho...@apache.org
Subject svn commit: r411890 - /apr/apr-util/trunk/include/apr_ldap_init.h
Date Mon, 05 Jun 2006 18:54:37 GMT
Author: bnicholes
Date: Mon Jun  5 11:54:37 2006
New Revision: 411890

URL: http://svn.apache.org/viewvc?rev=411890&view=rev
Log:
Since no all LDAP SDKs support the LDAP_SECURITY_ERROR macro, define the common macro APU_LDAP_SECURITY_ERROR.

Modified:
    apr/apr-util/trunk/include/apr_ldap_init.h

Modified: apr/apr-util/trunk/include/apr_ldap_init.h
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/include/apr_ldap_init.h?rev=411890&r1=411889&r2=411890&view=diff
==============================================================================
--- apr/apr-util/trunk/include/apr_ldap_init.h (original)
+++ apr/apr-util/trunk/include/apr_ldap_init.h Mon Jun  5 11:54:37 2006
@@ -35,6 +35,27 @@
 extern "C" {
 #endif /* __cplusplus */
 
+
+/**
+ * Macro to detect security related return values.
+ */
+#if defined(LDAP_INSUFFICIENT_ACCESS)
+#define APU_LDAP_INSUFFICIENT_ACCESS LDAP_INSUFFICIENT_ACCESS
+#elif defined(LDAP_INSUFFICIENT_RIGHTS)
+#define APU_LDAP_INSUFFICIENT_ACCESS LDAP_INSUFFICIENT_RIGHTS
+#endif
+
+#if defined(LDAP_SECURITY_ERROR1)
+#define APU_LDAP_SECURITY_ERROR LDAP_SECURITY_ERROR
+#else
+#define APU_LDAP_SECURITY_ERROR(n)	\
+    (LDAP_INAPPROPRIATE_AUTH == n) ? 1 \
+    : (LDAP_INVALID_CREDENTIALS == n) ? 1 \
+    : (APU_LDAP_INSUFFICIENT_ACCESS == n) ? 1 \
+    : 0
+#endif
+
+
 /**
  * APR LDAP SSL Initialise function
  *



Mime
View raw message