DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6431>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=6431

JNDIRealm.getRoles() should return more than a single role attribute

           Summary: JNDIRealm.getRoles() should return more than a single
                    role attribute
           Product: Tomcat 4
           Version: 4.0.2 Final
          Platform: All
        OS/Version: Other
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Catalina
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I am using the jndi realm with a Novell directory. In setting up the role query 
I am using:
  roleBase=""
  roleName="groupMembership"
  roleSearch="(&amp;(objectClass=person)(mail={1}@akc.org))"
  roleSubtree="true"
So I'm querying the user and getting all of group (role) attributes assigned to 
it.

In getRoles(DirContext, String, String) it does not loop through the list of 
attributes for the single entity. It only returns the first attribute.

I propose it be changed to the following code.

//Add enumeration & while to loop through all roles.
    NamingEnumeration rolesList = attr.getAll();
    while (rolesList.hasMore())
    {
        // String role = (String) attr.get();
        String role = (String) rolesList.next();
        if (debug >= 3)
            log("  Found role '" + role + "'");
        list.add(role);
    }

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

Reply via email to