DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=28631>.
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=28631

JAASRealm fix to permit user-specified user/group Principals

[EMAIL PROTECTED] changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|RESOLVED                    |REOPENED
         Resolution|FIXED                       |



------- Additional Comments From [EMAIL PROTECTED]  2004-09-30 21:54 -------
It looks like the most recent commit of JAASRealm has a slight problem in it. 

The whole-file version I submitted has these lines, starting at line 536:

            if (userPrincipal == null && userClasses.contains(principalClass)) {
                userPrincipal = principal;
                if( log.isDebugEnabled() ) {
                    log.debug(sm.getString("jaasRealm.userPrincipalSuccess", 
principal.getName()));
                }
            }
            if (roleClasses.contains(principalClass)) {
                roles.add(principal);
                if( log.isDebugEnabled() ) {
                    log.debug(sm.getString("jaasRealm.rolePrincipalAdd", 
principal.getName()));
                }
            }

The current file in HEAD looks like this (also starting at 536):

            if (userPrincipal == null && userClasses.contains(principalClass)) {
                userPrincipal = principal;
                if( log.isDebugEnabled() ) {
                    log.debug(sm.getString("jaasRealm.userPrincipalSuccess", 
principal.getName()));
                }
            }

            if (roleClasses.contains(principalClass)) {
                roles.add(principal.getName());
            }

            if (roleClasses.contains(principalClass)) {
                roles.add(principal);
                if( log.isDebugEnabled() ) {
                    log.debug(sm.getString("jaasRealm.rolePrincipalAdd", 
principal.getName()));
                }
            }

The middle chunk of code (3 lines) shouldn't be there. It is adding a String to what 
is supposed to be a 
collection of Principal objects. This is causing downstream calls to 
hasRole(Principal, String) to choke 
and die with a ClassCastException.

The patch file I submitted also has this middle chunk marked for removal (-), so I 
think this was just a 
mistake in the commit process.

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

Reply via email to