Author: markt
Date: Wed Mar 25 17:49:14 2009
New Revision: 758365
URL: http://svn.apache.org/viewvc?rev=758365&view=rev
Log:
Fix https://issues.apache.org/bugzilla/show_bug.cgi?id=45332
When reading tomcat-users.xml try to ensure the digester supports the java
encoding names. The windows installer will often use these names. The JVM does
this by default. If the endorsed mechanism is used, an alternative parser may
not support the Java encodings. This fix will only work for xerces.
Modified:
tomcat/trunk/java/org/apache/catalina/realm/LocalStrings.properties
tomcat/trunk/java/org/apache/catalina/realm/MemoryRealm.java
tomcat/trunk/java/org/apache/catalina/users/LocalStrings.properties
tomcat/trunk/java/org/apache/catalina/users/MemoryUserDatabase.java
Modified: tomcat/trunk/java/org/apache/catalina/realm/LocalStrings.properties
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/LocalStrings.properties?rev=758365&r1=758364&r2=758365&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/realm/LocalStrings.properties
(original)
+++ tomcat/trunk/java/org/apache/catalina/realm/LocalStrings.properties Wed Mar
25 17:49:14 2009
@@ -64,6 +64,7 @@
memoryRealm.loadExist=Memory database file {0} cannot be read
memoryRealm.loadPath=Loading users from memory database file {0}
memoryRealm.readXml=Exception while reading memory database file
+memoryRealm.xmlFeatureEncoding=Exception configuring digester to permit java
encoding names in XML files. Only IANA encoding names will be supported.
realmBase.algorithm=Invalid message digest algorithm {0} specified
realmBase.alreadyStarted=This Realm has already been started
realmBase.digest=Error digesting user credentials
Modified: tomcat/trunk/java/org/apache/catalina/realm/MemoryRealm.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/realm/MemoryRealm.java?rev=758365&r1=758364&r2=758365&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/realm/MemoryRealm.java (original)
+++ tomcat/trunk/java/org/apache/catalina/realm/MemoryRealm.java Wed Mar 25
17:49:14 2009
@@ -215,6 +215,13 @@
if (digester == null) {
digester = new Digester();
digester.setValidating(false);
+ try {
+ digester.setFeature(
+ "http://apache.org/xml/features/allow-java-encodings",
+ true);
+ } catch (Exception e) {
+ log.warn(sm.getString("memoryRealm.xmlFeatureEncoding"), e);
+ }
digester.addRuleSet(new MemoryRuleSet());
}
return (digester);
Modified: tomcat/trunk/java/org/apache/catalina/users/LocalStrings.properties
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/users/LocalStrings.properties?rev=758365&r1=758364&r2=758365&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/users/LocalStrings.properties
(original)
+++ tomcat/trunk/java/org/apache/catalina/users/LocalStrings.properties Wed Mar
25 17:49:14 2009
@@ -19,3 +19,4 @@
memoryUserDatabase.writeException=IOException writing to {0}
memoryUserDatabase.notPersistable=User database is not persistable - no write
permissions on directory
memoryUserDatabase.readOnly=User database has been configured to be read only.
Changes cannot be saved
+memoryUserDatabase.xmlFeatureEncoding=Exception configuring digester to permit
java encoding names in XML files. Only IANA encoding names will be supported.
Modified: tomcat/trunk/java/org/apache/catalina/users/MemoryUserDatabase.java
URL:
http://svn.apache.org/viewvc/tomcat/trunk/java/org/apache/catalina/users/MemoryUserDatabase.java?rev=758365&r1=758364&r2=758365&view=diff
==============================================================================
--- tomcat/trunk/java/org/apache/catalina/users/MemoryUserDatabase.java
(original)
+++ tomcat/trunk/java/org/apache/catalina/users/MemoryUserDatabase.java Wed Mar
25 17:49:14 2009
@@ -387,6 +387,13 @@
// Construct a digester to read the XML input file
Digester digester = new Digester();
+ try {
+ digester.setFeature(
+
"http://apache.org/xml/features/allow-java-encodings",
+ true);
+ } catch (Exception e) {
+
log.warn(sm.getString("memoryUserDatabase.xmlFeatureEncoding"), e);
+ }
digester.addFactoryCreate
("tomcat-users/group",
new MemoryGroupCreationFactory(this));
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]