You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by bu...@apache.org on 2002/02/13 19:21:47 UTC

DO NOT REPLY [Bug 6431] New: - JNDIRealm.getRoles() should return more than a single role attribute

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: tomcat-dev@jakarta.apache.org
        ReportedBy: mteegarden@yahoo.com


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:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>