Using JNDIRealm to authenticate against MS ActiveDirectory

2006-01-08 Thread Peter Meigs
In my company, our users mostly use Windows 2000/XP as their desktop.  Our 
application serves are normally run on some flavor of Unix and could be 
Solaris, Linux, or AIX.  To make our corporate security folks happy, I'd like 
to authenticate our Tomcat users against the MS Active Directory that supports 
the desktop logins and have been able to accomplish this.

The idea is to create Windows global groups in a Domain and then make users 
members of these groups.  This is a normal thing to do in Windows and there is 
Windows Software to support this.  These group names would become the role 
names that could be used in the web.xml or as an argument to the isUserInRole() 
method.

The server.xml definition that worked for me is (company name changed to a 
generic company.com)

ldap://DOMAINCONTROLLER2.company.com:389"; 
className="org.apache.catalina.realm.JNDIRealm" 
connectionName="[EMAIL PROTECTED]" connectionPassword="authenticationPassword" 
connectionURL="ldap://DOMAINCONTROLLER1.company.com:389"; 
contextFactory="com.sun.jndi.ldap.LdapCtxFactory" debug="99" 
roleBase="OU=ApplicationRoles,OU=Groups,OU=USA,DC=company,DC=com" 
roleName="cn" 
roleSearch="member={0}" 
roleSubtree="true" 
userBase="OU=Users,OU=USA,DC=company,DC=com" 
userSearch="([EMAIL PROTECTED])" 
userSubtree="false">


It was interesting to me that in ActiveDirectory, the email address seemed to 
work for finding the users.

This works fine except the roles are two closely tied to the users.  I'd like 
to see a three tier structure where we have users, roles, and capabilities.  
I'm redefining the word "role" here now a little from what Tomcat used before 
but I think what I am proposing will work out.  

I'd like to assign capabilites to roles and then assign roles to users.  In the 
Windows Active Directory, this works out because users have a memberOf 
attribute that say what Groups they are members of, but it turns out that 
Groups can be memberOf other Groups.  My convention for this is to make 
capabilities start with the word "Can" and roles start with the word "Role".  
So we could have capabilites CanLogin, CanUpdateDataBase, CanRunSpecialApp and 
roles RoleBasicUser, RoleAdvancedUser, RolePrivilegedUser.  A user would be a 
memberOf RoleAdvancedUser for example.  All roles imply the ability to log in, 
so all Roles would be memberOf CanLogin.  RoleAdvancedUser would also me a 
memberOf CanRunSpecialApp.

I've looked at the code in JNDIRealm and it only supports Users as memberOf a 
(in my terminology) a capability.  I created a new module I call ActiveDirRealm 
that accomplishes this.  The module is a few changes to JNDIRealm.  It also 
adds a parameter roleLink to specify the memberOf attribute.  I have tested it 
in my environment and it seems to work.  The server,xml then becomes:

ldap://DOMAINCONTROLLER2.company.com:389"; 
className="org.apache.catalina.realm.JNDIRealm" 
connectionName="[EMAIL PROTECTED]" connectionPassword="authenticationPassword" 
connectionURL="ldap://DOMAINCONTROLLER1.company.com:389"; 
contextFactory="com.sun.jndi.ldap.LdapCtxFactory" debug="99" 
roleBase="OU=ApplicationRoles,OU=Groups,OU=USA,DC=company,DC=com" 
roleName="cn" 
  roleLink="memberOf"
roleSearch="member={0}" 
roleSubtree="true" 
userBase="OU=Users,OU=USA,DC=company,DC=com" 
userSearch="([EMAIL PROTECTED])" 
userSubtree="false">


I think this would be a nice addition to JNDIRealm but I'm not sure how to 
propose this for a future Tomcat.  I'm happy to share my implementation of 
ActiveDirRealm but it is too large to include here (about 1800 lines, similar 
to JNDI Realm)

Another question I have is whether this should be an extension to JNDIRealm or 
a separate module.

Peter Meigs
[EMAIL PROTECTED]











svn commit: r367054 - /tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/

2006-01-08 Thread markt
Author: markt
Date: Sun Jan  8 09:49:20 2006
New Revision: 367054

URL: http://svn.apache.org/viewcvs?rev=367054&view=rev
Log:
Code clean up in o.a.c.mbeans

Modified:

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/ConnectorMBean.java

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/ContextEnvironmentMBean.java

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/ContextResourceLinkMBean.java

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/ContextResourceMBean.java

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/DefaultContextMBean.java

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/GlobalResourcesLifecycleListener.java

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/GroupMBean.java

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/MBeanFactory.java

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/MBeanUtils.java

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/NamingResourcesMBean.java

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/RoleMBean.java

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/ServerLifecycleListener.java

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/StandardContextMBean.java

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/StandardEngineMBean.java

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/StandardHostMBean.java

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/StandardServerMBean.java

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/StandardServiceMBean.java

tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/UserMBean.java

Modified: 
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/ConnectorMBean.java
URL: 
http://svn.apache.org/viewcvs/tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/ConnectorMBean.java?rev=367054&r1=367053&r2=367054&view=diff
==
--- 
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/ConnectorMBean.java
 (original)
+++ 
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/ConnectorMBean.java
 Sun Jan  8 09:49:20 2006
@@ -19,9 +19,6 @@
 import java.lang.reflect.Method;
 import javax.management.MBeanException;
 import javax.management.RuntimeOperationsException;
-import org.apache.catalina.Connector;
-import org.apache.catalina.Service;
-import org.apache.commons.modeler.BaseModelMBean;
 
 
 /**

Modified: 
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/ContextEnvironmentMBean.java
URL: 
http://svn.apache.org/viewcvs/tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/ContextEnvironmentMBean.java?rev=367054&r1=367053&r2=367054&view=diff
==
--- 
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/ContextEnvironmentMBean.java
 (original)
+++ 
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/ContextEnvironmentMBean.java
 Sun Jan  8 09:49:20 2006
@@ -17,13 +17,10 @@
 package org.apache.catalina.mbeans;
 
 
-import java.util.ArrayList;
 import javax.management.Attribute;
 import javax.management.AttributeNotFoundException;
 import javax.management.InstanceNotFoundException;
-import javax.management.MalformedObjectNameException;
 import javax.management.MBeanException;
-import javax.management.ObjectName;
 import javax.management.ReflectionException;
 import javax.management.RuntimeOperationsException;
 import javax.management.modelmbean.InvalidTargetObjectTypeException;

Modified: 
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/ContextResourceLinkMBean.java
URL: 
http://svn.apache.org/viewcvs/tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/ContextResourceLinkMBean.java?rev=367054&r1=367053&r2=367054&view=diff
==
--- 
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/ContextResourceLinkMBean.java
 (original)
+++ 
tomcat/container/branches/tc4.1.x/catalina/src/share/org/apache/catalina/mbeans/ContextResourceLinkMBean.java
 Sun Jan  8 09:49:20 2006
@@ -17,19 +17,15 @@
 package org.apache.catalina.mbeans;
 
 
-import java.util.ArrayList;
 import javax.management.Attribute;
 import 

Bug report for Tomcat 3 [2006/01/08]

2006-01-08 Thread bugzilla
+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=CriticalMAJ=Major |
| |   |   MIN=Minor   NOR=Normal  ENH=Enhancement   |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
| 2350|Ver|Nor|2001-06-27|ServletConfig.getInitParameter() requires url-patt|
| 2478|Opn|Cri|2001-07-06|Passing Session variables between JSP's and Servle|
| 4551|Opn|Nor|2001-10-31|Ctx( /tt01 ): IOException in: R( /tt01 + /com/abc/|
| 4980|New|Min|2001-11-20|Startup message indicates incorrect log file  |
| 4994|New|Nor|2001-11-21|Tomcat needs a mechanism for clean and certain shu|
| 5064|New|Cri|2001-11-25|Socket write error when include files is more than|
| 5108|New|Maj|2001-11-26|Docs for Tomcat 3.2.x appear to be for Tomcat 3.3 |
| 5137|New|Nor|2001-11-27|Null pointer in class loader after attempting to r|
| 5160|Unc|Maj|2001-11-28|'IllegalStateException'   |
| 5331|New|Nor|2001-12-09|getPathInfo vs URL normalization  |
| 5510|New|Blk|2001-12-19|How to call ejb deployed in JBoss from Tomcat serv|
| 5756|New|Nor|2002-01-08|jspc.bat exits with wrong ERRORLEVEL  |
| 5797|New|Nor|2002-01-10|UnCatched ? StringIndexOutOfBoundsException: Strin|
| 6027|New|Maj|2002-01-25|Tomcat  Automatically shuts down as service   |
| 6168|New|Blk|2002-02-01|IllegalStateException |
| 6451|New|Cri|2002-02-14|Stackoverflow |
| 6478|New|Enh|2002-02-14|Default Tomcat Encoding   |
| 6488|Ver|Maj|2002-02-15|Error: 304. Apparent bug in default ErrorHandler c|
| 6648|New|Nor|2002-02-25|jakarta-servletapi build with java 1.4 javadoc err|
| 6702|New|Cri|2002-02-27|win 2k services not working   |
| 6796|New|Cri|2002-03-01|Tomcat dies periodically  |
| 6989|New|Maj|2002-03-08|Unable to read tld file during parallel JSP compil|
| 7013|New|Cri|2002-03-10|Entering a servlet path with non-ISO8859-1 charact|
| 7227|New|Nor|2002-03-19| directive don't work |
| 7626|New|Nor|2002-03-29|classloader not working properly  |
| 7652|New|Cri|2002-04-01|Tomcat stalls periodically|
| 7785|New|Blk|2002-04-06|tomcat bug in context reloading   |
| 7863|New|Maj|2002-04-09|I have a problem when running Tomcat with IIS |
| 8187|New|Cri|2002-04-17|Errors when Tomcat used with MS Access database   |
| 8239|New|Cri|2002-04-18|Resource temporary unavailable|
| 8263|New|Cri|2002-04-18|url-pattern easy to circumvent|
| 9250|New|Maj|2002-05-20|outOfMemoryError  |
| 9367|New|Maj|2002-05-23|HttpSessionBindingEvent not thrown for HttpSession|
| 9390|New|Nor|2002-05-24|jasper compilation error in tomcat|
| 9480|New|Nor|2002-05-29|Data connection pooling   |
| 9607|New|Maj|2002-06-04|precompile JSP|
| 9737|Ver|Nor|2002-06-10|ArrayIndexOutOfBoundsException when sending just p|
|10047|New|Cri|2002-06-20|IllegalStateException |
|10202|New|Maj|2002-06-25|Tomcat is not responding in time  |
|10357|Unc|Blk|2002-06-30|java.lang.IllegalArgumentException: Short Read|
|10406|New|Cri|2002-07-02|IllegalStateException |
|11087|New|Blk|2002-07-23|IllegalStateException |
|11286|New|Maj|2002-07-30|Tomcat threads not respond if increase JVM size   |
|11466|New|Nor|2002-08-05|ContextManager: SocketException reading request   |
|12156|New|Cri|2002-08-29|Apache and Tomcat 3.3.1 Interworking problem  |
|12194|New|Maj|2002-08-30|Tomcat does not send WWW-Authenticate header  |
|12852|New|Nor|2002-09-20|May be error in _jspService() -> out.flushBuffers(|
|14386|New|Maj|2002-11-08|Date headers corrupted using setDateHeader|
|15632|New|Nor|2002-12-23|Problem with the Tomcat Sessions Parameter on URL |
|16363|New|Cri|2003-01-23|Stack Overflow accessing compiled JSP - Tomcat 3.2|
|17081|New|Min|2003-02-14|Some javadoc comment fixes|
|17915|New|Maj|2003

Bug report for Watchdog [2006/01/08]

2006-01-08 Thread bugzilla
+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=CriticalMAJ=Major |
| |   |   MIN=Minor   NOR=Normal  ENH=Enhancement   |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
|  278|Unc|Nor|2000-12-04|Bug in GetParameterValuesTestServlet.java file Bug|
|  279|Unc|Nor|2000-12-04|Logical Error in GetParameterValuesTestServlet Bug|
|  469|Unc|Nor|2001-01-17|in example-taglib.tld "urn" should be "uri" BugRat|
|  470|Unc|Nor|2001-01-17|FAIL positiveForward.jsp and positiveInclude.jsp B|
| 9634|New|Enh|2002-06-05|No tests exist for ServletContext.getResourcePaths|
|10703|New|Enh|2002-07-11|Need to test getRequestURI after RequestDispatcher|
|11336|New|Enh|2002-07-31|Test wrapped path methods with RD.foward()|
|11663|New|Maj|2002-08-13|JSP precompile tests rely on Jasper specific behav|
|11664|New|Maj|2002-08-13|A sweep is needed of all Watchdog 4.0 tag librarie|
|11665|New|Maj|2002-08-13|ServletToJSPErrorPageTest and ServletToServletErro|
|11666|New|Maj|2002-08-13|SetBufferSize_1TestServlet is invalid.|
|14004|New|Maj|2002-10-28|Incorrent behaviour of all attribute-related lifec|
|15504|New|Nor|2002-12-18|JSP positiveGetValues test relies on order preserv|
|24649|New|Nor|2003-11-12|getRemoteHost fails when agent has uppercase chara|
|29398|New|Nor|2004-06-04|Update site and note current status   |
+-+---+---+--+--+
| Total   15 bugs   |
+---+

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Bug report for Tomcat 4 [2006/01/08]

2006-01-08 Thread bugzilla
+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=CriticalMAJ=Major |
| |   |   MIN=Minor   NOR=Normal  ENH=Enhancement   |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
| 3839|Opn|Enh|2001-09-26|Problem bookmarking login page|
| 4227|Opn|Enh|2001-10-17|Invalid CGI path  |
| 5329|New|Enh|2001-12-08|NT Service exits startup before Tomcat is finished|
| 5795|New|Enh|2002-01-10|Catalina Shutdown relies on localhost causing prob|
| 5829|New|Enh|2002-01-13|StandardManager needs to cope with sessions throwi|
| 5985|New|Enh|2002-01-23|Tomcat should perform a more restrictive validatio|
| 6600|Opn|Enh|2002-02-20|enodeURL adds 'jsession' when 'isRequestedSessionI|
| 6614|New|Enh|2002-02-21|Have Bootstrap and StandardClassLoader use the sam|
| 6671|New|Enh|2002-02-25|Simple custom tag example uses old declaration sty|
| 7043|New|Enh|2002-03-12|database user and password for JDBC Based Store   |
| 7374|New|Enh|2002-03-22|Apache Tomcat/4.0.1 message on standard output|
| 7676|New|Enh|2002-04-02|Allow name property to use match experssions in  without className in server.xml produces N|
|11069|Opn|Enh|2002-07-23|Tomcat not flag error if tld is outside of /WEB-IN|
|11129|New|Enh|2002-07-24|New valve for putting the sessionIDs in the reques|
|11248|New|Enh|2002-07-29|DefaultServlet doesn't send expires header|
|11754|Opn|Enh|2002-08-15|Synchronous shutdown script - shutdown.sh should w|
|12069|New|Enh|2002-08-27|Creation of more HttpSession objects for one previ|
|12658|New|Enh|2002-09-15|a proxy host and port at the  element level |
|12766|New|Enh|2002-09-18|Tomcat should use tld files in /WEB-INF/ over vers|
|13309|Opn|Enh|2002-10-04|Catalina calls System.exit()  |
|13634|New|Enh|2002-10-15|Allowing system properties to be substituted in co|
|13689|Opn|Enh|2002-10-16|Classloader paths for 'Common' classes and librari|
|13731|New|Enh|2002-10-17|Final request, response, session and other variabl|
|13846|New|Nor|2002-10-22|If-Modified-Since results in incorrect headers|
|13941|New|Enh|2002-10-24|reload is VERY slow   |
|13965|New|Enh|2002-10-25|Catalina.sh correction request for Tru64 Unix |
|13983|New|Nor|2002-10-25|RMI call from Web Application throws SocketExcepti|
|14097|New|Enh|2002-10-30|hardcoded registry value for vm lets tomcat servic|
|14416|New|Enh|2002-11-10|blank tag name in TLD cause NullPointerException  |
|14635|New|Enh|2002-11-18|Should be possible not to have -MM-DD in log f|
|14766|New|Enh|2002-11-22|Redirect Vavle|
|14993|New|Enh|2002-12-02|Possible obselete synchronized declaration|
|15115|New|Enh|2002-12-05|correct docs... XML parser *cannot* be overridden |
|15417|Opn|Enh|2002-12-16|Add port for forced compilation of JSP pages  |
|15688|New|Enh|2002-12-27|full-qualified names instead of imports   |
|15893|New|Enh|2003-01-08|Need a getPort() method on Connector or similar fu|
|15941|New|Enh|2003-01-10|Expose rootCause exceptions at deeper levels  |
|15946|New|Nor|2003-01-10|Documentation change  |
|16294|New|Enh|2003-01-21|Configurable URL Decoding.|
|16357|New|Enh|2003-01-23|"connection timeout reached"  |
|16531|New|Enh|2003-01-29|Updating already deployed ".war" files in a single|
|16579|New|Enh|2003-01-30|documentation page layout/style breaks wrapping to|
|16596|New|Enh|2003-01-30|option for disabling log rotation |
|17070|New|Enh|2003-02-14|The Catalina Ant tasks do not allow for 'reusable'|
|17146|New|Enh|2003-02-18|Simplify build.xml using 

Bug report for Tomcat 5 [2006/01/08]

2006-01-08 Thread bugzilla
+---+
| Bugzilla Bug ID   |
| +-+
| | Status: UNC=Unconfirmed NEW=New ASS=Assigned|
| | OPN=ReopenedVER=Verified(Skipped Closed/Resolved)   |
| |   +-+
| |   | Severity: BLK=Blocker CRI=CriticalMAJ=Major |
| |   |   MIN=Minor   NOR=Normal  ENH=Enhancement   |
| |   |   +-+
| |   |   | Date Posted |
| |   |   |  +--+
| |   |   |  | Description  |
| |   |   |  |  |
|17310|Ver|Nor|2003-02-22|;jsessionid confuses StandardHostcan't find Co|
|19803|Ver|Maj|2003-05-09|manager reload fails and disables app - Incompatib|
|19958|Ver|Maj|2003-05-15|Problems reading ServletInputStream   |
|21045|Ver|Nor|2003-06-24|Manager app does find resources   |
|21600|Ver|Nor|2003-07-15|'s lost after manager stop/start or rel|
|22679|Ver|Enh|2003-08-24|how to access ssl session ID out of tomcat to prev|
|22986|Ver|Nor|2003-09-08|Web apps with context XML file don't start if CATA|
|24413|Ver|Nor|2003-11-04|bundled JMX implementation not compliant to specif|
|24943|Ver|Nor|2003-11-24|Tomcat 5.0.14 / Windows 2000 Service does not star|
|25078|Ver|Nor|2003-11-29|Catalina Ant Serverinfo task always fails |
|27338|Ver|Maj|2004-03-01|Wrong mappings for JSP Documents (.jspx)  |
|28039|New|Enh|2004-03-30|Cluster Support for SingleSignOn  |
|28633|Ass|Enh|2004-04-27|Add JMX Support to ClusterManager |
|28634|Ass|Enh|2004-04-27|Extend StandardManager/StandardSession for DeltaMa|
|28709|Ver|Nor|2004-04-30|javax.servlet.http.HttpServletRequest.isRequestedS|
|28875|Ver|Nor|2004-05-10|Multi-byte characters in default error page aren't|
|29091|Opn|Nor|2004-05-19|Non-ascii characters are not handled correctly... |
|29160|Ver|Enh|2004-05-23|precompile problem: _jspx_meth_* (javax.servlet.js|
|29494|Opn|Enh|2004-06-10|No way to set PATH when running as a service on Wi|
|29497|Unc|Nor|2004-06-10|Connection pool, redeployment |
|29521|Ver|Cri|2004-06-11|No destroy methods called on service shutdown |
|30241|Ver|Enh|2004-07-21|Enhance build script to use branch argument when c|
|30489|Opn|Cri|2004-08-05|removeAttribute: Session already invalidated  |
|30833|Ver|Nor|2004-08-24|request.getServerPort() returns wrong port (WAS: r|
|31125|Opn|Nor|2004-09-08|conf/web.xml not valid|
|32081|Opn|   |2004-11-05|Wrapper scripts require a JDK to be present.  |
|32180|New|Nor|2004-11-11|EL functions are executed in privileged context   |
|32280|Ver|Cri|2004-11-17|Problem clustering tomcat when a failed server is |
|32569|Ass|Nor|2004-12-07|ServletContextListener will not die   |
|32593|Inf|Maj|2004-12-09|Server (Apache 2.0.48) reached MaxClients setting |
|32754|Inf|Nor|2004-12-17|Can't modify thread configuration attributes of AJ|
|32832|Ver|Maj|2004-12-23|request.getSession(false) fails to return null.   |
|33180|Ver|Nor|2005-01-20|JSTL automatic type conversion gives unexpected re|
|33262|Inf|Nor|2005-01-27|Service Manager autostart should check for adminis|
|33356|Inf|Maj|2005-02-02|Incorrect parsing of tag attributes   |
|33407|Inf|Nor|2005-02-05|\$ is quoted even with el-ignored=true|
|33453|Opn|Enh|2005-02-08|Jasper should recompile JSP files whose datestamps|
|33494|New|Enh|2005-02-10|jscv configure script fails on x86_64 |
|33650|Inf|Enh|2005-02-19|Jasper performance for multiple files processing  |
|33671|Opn|Enh|2005-02-21|Manual Windows service installation with custom na|
|33806|Opn|Maj|2005-03-02|Session tracking using URL rewriting fails, if cli|
|33831|Ver|Nor|2005-03-03|RequestDispatcher.forward and resource missing|
|34006|Ver|Nor|2005-03-14|Undeploy of webapps with antiResourceLocking in ME|
|34016|Ver|Nor|2005-03-15|antiResourceLocking webapp fails to deploy on Tomc|
|34033|Ver|Nor|2005-03-16|Cannot delete users using Administration Tool weba|
|34076|Inf|Nor|2005-03-18|overriding content.xml docBase with manager webapp|
|34319|New|Nor|2005-04-06|StoreBase.processExpires() is very inefficient|
|34396|Inf|   |2005-04-11|security exception using datasource in|
|35606|New|Maj|2005-07-05|Problem with Session cookies and multiple webapps |
|35635|New|Nor|2005-07-06|Tomcat service does not log startup error messages|
|35710|Inf|Enh|2005-07-12|Cross-Context Session Replication |
|35715|New

svn commit: r367115 - /tomcat/connectors/trunk/coyote/src/java/org/apache/coyote/Response.java

2006-01-08 Thread markt
Author: markt
Date: Sun Jan  8 14:48:43 2006
New Revision: 367115

URL: http://svn.apache.org/viewcvs?rev=367115&view=rev
Log:
Fix bug 29214. containsHeader() not working for Content-Length and Content-Type

Modified:
tomcat/connectors/trunk/coyote/src/java/org/apache/coyote/Response.java

Modified: 
tomcat/connectors/trunk/coyote/src/java/org/apache/coyote/Response.java
URL: 
http://svn.apache.org/viewcvs/tomcat/connectors/trunk/coyote/src/java/org/apache/coyote/Response.java?rev=367115&r1=367114&r2=367115&view=diff
==
--- tomcat/connectors/trunk/coyote/src/java/org/apache/coyote/Response.java 
(original)
+++ tomcat/connectors/trunk/coyote/src/java/org/apache/coyote/Response.java Sun 
Jan  8 14:48:43 2006
@@ -117,6 +117,16 @@
 protected boolean charsetSet = false;
 
 /**
+ * Has the content length been explicitly set.
+ */
+protected boolean contentLengthSet = false;
+
+/**
+ * Has the content type been explicitly set.
+ */
+protected boolean contentTypeSet = false;
+
+/**
  * Request error URI.
  */
 protected String errorURI = null;
@@ -276,12 +286,15 @@
 
 // Reset the headers only if this is the main request,
 // not for included
-contentType = null;;
+contentType = null;
 locale = DEFAULT_LOCALE;
 contentLanguage = null;
 characterEncoding = Constants.DEFAULT_CHARACTER_ENCODING;
 contentLength = -1;
 charsetSet = false;
+contentTypeSet = false;
+contentLengthSet = false;
+
 
 status = 200;
 message = null;
@@ -312,6 +325,14 @@
 
 //  Headers 
 public boolean containsHeader(String name) {
+char cc=name.charAt(0);
+if(cc=='C' || cc=='c') {
+if(name.equalsIgnoreCase("Content-Type")) {
+return contentTypeSet;
+} else if(name.equalsIgnoreCase("Content-Length")) {
+return contentLengthSet;
+}
+}
 return headers.getHeader(name) != null;
 }
 
@@ -361,6 +382,7 @@
 }
 if( name.equalsIgnoreCase( "Content-Language" ) ) {
 // XXX XXX Need to construct Locale or something else
+// Needs special handling in containsHeader() as well
 }
 return false;
 }
@@ -454,9 +476,12 @@
 
 if (type == null) {
 this.contentType = null;
+contentTypeSet = false;
 return;
 }
 
+contentTypeSet = true;
+
 /*
  * Remove the charset param (if any) from the Content-Type, and use it
  * to set the response encoding.
@@ -469,7 +494,7 @@
 while (index != -1) {
 semicolonIndex = index;
 index++;
-while (index < len && Character.isSpace(type.charAt(index))) {
+while (index < len && Character.isWhitespace(type.charAt(index))) {
 index++;
 }
 if (index+8 < len
@@ -526,10 +551,12 @@
 
 public void setContentLength(int contentLength) {
 this.contentLength = contentLength;
+contentLengthSet = true;
 }
 
 public void setContentLength(long contentLength) {
 this.contentLength = contentLength;
+contentLengthSet = true;
 }
 
 public int getContentLength() {
@@ -565,6 +592,8 @@
 locale = DEFAULT_LOCALE;
 characterEncoding = Constants.DEFAULT_CHARACTER_ENCODING;
 charsetSet = false;
+contentLengthSet = false;
+contentTypeSet = false;
 contentLength = -1;
 status = 200;
 message = null;



-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 29214] - response containsHeader("Content-Type") not working

2006-01-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=29214


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||FIXED




--- Additional Comments From [EMAIL PROTECTED]  2006-01-08 23:51 ---
This has now been fixed in SVN.

Based on the wording on the spec for setContentLength() which states that
calling this method sets the Content-Length header for HTTP servlets,
containsHeader() now returns true if the Content-Length or Content-Type has been
set directly by setHeader or indirectly by setContentLength() etc.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



DO NOT REPLY [Bug 9027] - The Tomcat Servlet Container use the identity specified in a servlet with the element for every web component.

2006-01-08 Thread bugzilla
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=9027


[EMAIL PROTECTED] changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution||INVALID




--- Additional Comments From [EMAIL PROTECTED]  2006-01-09 00:49 ---
When integrated with an EJB container, the EJB container is responsible for
calling the internal Tomcat method Wrapper.getRunAS(). For example, the
JBoss-Tomcat integration code does this.

As far as I can tell, Tomcat correctly saves the runAs information on a per
servlet basis and also correctly sets it in the case of JSPs as per the test
case provided. Therefore, this looks like a bug with the Sun Reference
implementation.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
--- You are receiving this mail because: ---
You are the assignee for the bug, or are watching the assignee.

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]