Bug 35758 - Admin webapp does not save correctly the JDBCRealm XML tag.
Summary: Admin webapp does not save correctly the JDBCRealm XML tag.
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Webapps:Administration (show other bugs)
Version: 5.5.9
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2005-07-15 20:12 UTC by Gabriel Belingueres
Modified: 2005-07-22 07:48 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Gabriel Belingueres 2005-07-15 20:12:23 UTC
Hi,

I have a problem when configuring a JDBCRealm from the admin tool.

I use no digest algorithm, so I leave the digest text field in blank, but the
generated server.xml file includes an oughfull:
digest=""
attribute, so Tomcat throws me an exception telling me that it can not find the 
required ("") digest algorithm.

I removed the offending line from server.xml and it works perfectly.

Unfortunatelly, my hosting service only allow me to use the admin app. (As a 
workaround, I included the META-INF/context.xml file with the right tags and it 
worked ok)

How can I tell from the admin app that don't generate the digest attribute?
I already test it with: "No", "NO", "NONE" y "null" but doesn't work.

I checked the source code and the SaveJDBCRealmAction Action class has the 
following code in line 235:

attribute = "digest";
mBServer.setAttribute(roname,
       new Attribute("digest",  rform.getDigest()));

May it be guarded like this?

if ( rform.getDigest() != null && !"".equals(rform.getDigest().trim()) ) {
  attribute = "digest";
  mBServer.setAttribute(roname,
         new Attribute("digest",  rform.getDigest()));
}

Thanks in advance
Gabriel

PS: Didn't check it but it may be worth to look at the code of DataSourceRealm 
since it may have similar problems.-
Comment 1 Yoav Shapira 2005-07-22 15:48:11 UTC
Fixed with the type of check you suggested on all JDBCRealm attributes.  Thanks.