apr-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bnicho...@apache.org
Subject svn commit: r613295 - in /apr/apr-util/trunk: include/apr_ldap_option.h ldap/apr_ldap_option.c
Date Fri, 18 Jan 2008 21:57:50 GMT
Author: bnicholes
Date: Fri Jan 18 13:57:49 2008
New Revision: 613295

URL: http://svn.apache.org/viewvc?rev=613295&view=rev
Log:
Add a couple of options to apr_ldap_set_option (APR_LDAP_OPT_REFERALS,
APR_LDAP_OPT_REFHOPLIMIT)

submitted by: Paul J Reder <rederpj remulak.net>
reviewed by: Brad Nicholes

Modified:
    apr/apr-util/trunk/include/apr_ldap_option.h
    apr/apr-util/trunk/ldap/apr_ldap_option.c

Modified: apr/apr-util/trunk/include/apr_ldap_option.h
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/include/apr_ldap_option.h?rev=613295&r1=613294&r2=613295&view=diff
==============================================================================
--- apr/apr-util/trunk/include/apr_ldap_option.h (original)
+++ apr/apr-util/trunk/include/apr_ldap_option.h Fri Jan 18 13:57:49 2008
@@ -56,6 +56,16 @@
  * all servers are considered trusted.
  */
 #define APR_LDAP_OPT_VERIFY_CERT 0x6ffd
+/**
+ * Set the LDAP library to indicate if referrals should be chased during
+ * LDAP searches.
+ */
+#define APR_LDAP_OPT_REFERRALS 0x6ffc
+/**
+ * Set the LDAP library to indicate a maximum number of referral hops to
+ * chase before giving up on the search.
+ */
+#define APR_LDAP_OPT_REFHOPLIMIT 0x6ffb
 
 /**
  * Structures for the apr_set_option() cases

Modified: apr/apr-util/trunk/ldap/apr_ldap_option.c
URL: http://svn.apache.org/viewvc/apr/apr-util/trunk/ldap/apr_ldap_option.c?rev=613295&r1=613294&r2=613295&view=diff
==============================================================================
--- apr/apr-util/trunk/ldap/apr_ldap_option.c (original)
+++ apr/apr-util/trunk/ldap/apr_ldap_option.c Fri Jan 18 13:57:49 2008
@@ -144,6 +144,42 @@
             result->reason = "LDAP: Could not set verify mode";
         }
         break;
+
+    case APR_LDAP_OPT_REFERRALS:
+        /* Setting this option is supported on at least TIVOLI_SDK and OpenLDAP. Folks
+         * who know the NOVELL, NETSCAPE, MOZILLA, and SOLARIS SDKs should note here if
+         * the SDK at least tolerates this option being set, or add an elif to handle
+         * special cases (i.e. different LDAP_OPT_X value).
+         */
+        result->rc = ldap_set_option(ldap, LDAP_OPT_REFERRALS, (void *)invalue);
+
+        if (result->rc != LDAP_SUCCESS) {
+            result->reason = "Unable to set LDAP_OPT_REFERRALS.";
+          return(result->rc);
+        }
+        break;
+
+    case APR_LDAP_OPT_REFHOPLIMIT:
+#if APR_HAS_OPENLDAP_LDAPSDK
+        /* Setting this option is not supported by current versions of OpenLDAP,
+         * OpenLDAP does support the concept though and defaults to 5.
+         */
+        result->rc = LDAP_SUCCESS;
+#else
+        /* Setting this option is supported on at least TIVOLI_SDK. Folks who know
+         * the NOVELL, NETSCAPE, MOZILLA, and SOLARIS SDKs should note here if
+         * the SDK at least tolerates this option being set, or add an elif to handle
+         * special cases so an error isn't returned if there is a perfectly good
+         * default value that just can't be changed (like openLDAP).
+         */
+        result->rc = ldap_set_option(ldap, LDAP_OPT_REFHOPLIMIT, (void *)invalue);
+#endif
+
+        if (result->rc != LDAP_SUCCESS) {
+            result->reason = "Unable to set LDAP_OPT_REFHOPLIMIT.";
+          return(result->rc);
+        }
+        break;
         
     default:
         /* set the option specified using the native LDAP function */



Mime
View raw message