markt 2004/10/10 13:43:49
Modified: catalina/src/share/org/apache/catalina/realm JNDIRealm.java
webapps/docs changelog.xml
webapps/docs/config realm.xml
Log:
Fix bug 31273. Add support for derefAliases.
- Ported from TC4
Revision Changes Path
1.15 +29 -1
jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm/JNDIRealm.java
Index: JNDIRealm.java
===================================================================
RCS file:
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/realm/JNDIRealm.java,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- JNDIRealm.java 23 Jun 2004 13:51:37 -0000 1.14
+++ JNDIRealm.java 10 Oct 2004 20:43:49 -0000 1.15
@@ -193,6 +193,17 @@
*/
protected String contextFactory = "com.sun.jndi.ldap.LdapCtxFactory";
+
+ /**
+ * How aliases should be dereferenced during search operations.
+ */
+ protected String derefAliases = null;
+
+ /**
+ * Constant that holds the name of the environment property for specifying
+ * the manner in which aliases should be dereferenced.
+ */
+ public final static String DEREF_ALIASES = "java.naming.ldap.derefAliases";
/**
* Descriptive information about this Realm implementation.
@@ -443,6 +454,21 @@
}
+ /**
+ * Return the derefAliases setting to be used.
+ */
+ public java.lang.String getDerefAliases() {
+ return derefAliases;
+ }
+
+ /**
+ * Set the value for derefAliases to be used when searching the directory.
+ *
+ * @param derefAliases New value of property derefAliases.
+ */
+ public void setDerefAliases(java.lang.String derefAliases) {
+ this.derefAliases = derefAliases;
+ }
/**
* Return the protocol to be used.
@@ -1505,6 +1531,8 @@
env.put(Context.SECURITY_PROTOCOL, protocol);
if (referrals != null)
env.put(Context.REFERRAL, referrals);
+ if (derefAliases != null)
+ env.put(JNDIRealm.DEREF_ALIASES, derefAliases);
return env;
1.145 +3 -0 jakarta-tomcat-catalina/webapps/docs/changelog.xml
Index: changelog.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/changelog.xml,v
retrieving revision 1.144
retrieving revision 1.145
diff -u -r1.144 -r1.145
--- changelog.xml 7 Oct 2004 13:09:17 -0000 1.144
+++ changelog.xml 10 Oct 2004 20:43:49 -0000 1.145
@@ -40,6 +40,9 @@
<fix>
<bug>31578</bug>: Update Manager configuration documentation. (yoavs)
</fix>
+ <fix>
+ <bug>31273</bug>: Add support for derefaliases in JNDIRealm. (markt)
+ </fix>
</changelog>
</subsection>
1.6 +6 -0 jakarta-tomcat-catalina/webapps/docs/config/realm.xml
Index: realm.xml
===================================================================
RCS file: /home/cvs/jakarta-tomcat-catalina/webapps/docs/config/realm.xml,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- realm.xml 15 Jan 2003 03:40:44 -0000 1.5
+++ realm.xml 10 Oct 2004 20:43:49 -0000 1.6
@@ -300,6 +300,12 @@
assumes that the standard JNDI LDAP provider will be utilized.</p>
</attribute>
+ <attribute name="derefAliases" required="false">
+ <p>A string specifying how aliases are to be dereferenced during
+ search operations. The allowed values are "always", "never",
+ "finding" and "searching". If not specified, "always" is used.</p>
+ </attribute>
+
<attribute name="protocol" required="false">
<p>A string specifying the security protocol to use. If not given
the providers default is used.</p>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]