tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 40720] New: - Adding groups to a user throws an error
Date Wed, 11 Oct 2006 07:54:49 GMT
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=40720>.
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=40720

           Summary: Adding groups to a user throws an error
           Product: Tomcat 5
           Version: 5.5.17
          Platform: Other
        OS/Version: other
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Webapps:Administration
        AssignedTo: tomcat-dev@jakarta.apache.org
        ReportedBy: jcstover@nilling.nl


Error is caused by the fact that somehow the group looked for is surrouded by "" so looking
for group1 
"group1" is searched for.

Simpel solution I added in org.apache.catalina.mbeans.UserMBean is the removal of " from the

groupname when searching for it.

    public void addGroup(String groupname) {

        User user = (User) this.resource;
        if (user == null) {
            return;
        }
        String lookupGroupname = groupname.replaceAll("\"", "");
        Group group = user.getUserDatabase().findGroup(lookupGroupname);
        if (group == null) {
            throw new IllegalArgumentException
                ("Invalid group name '" + lookupGroupname + "'");
        }
        user.addGroup(group);

    }

the only change I made is the adding of replaceAll 

Sorry for not making a proper patch file but I don't know how to do it. Hope you can implement
this 
solution so adding of groups to a user works.

-- 
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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message