From b4430e6a309f83fdaa7146bd6f3f7e3b1dca589c Mon Sep 17 00:00:00 2001 From: Robert Gemmell Date: Fri, 6 Nov 2009 16:51:56 +0000 Subject: QPID-2189: use an ObjectName pattern instead of the precise key value in the queryNames call to avoid incorrectly tripping the security when connecting to pre-0.6 brokers as a non-admin user git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@833467 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'java/management/eclipse-plugin/src') diff --git a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java index 69a466c943..5234535fe5 100644 --- a/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java +++ b/java/management/eclipse-plugin/src/main/java/org/apache/qpid/management/ui/jmx/MBeanUtility.java @@ -45,7 +45,6 @@ import javax.management.ObjectName; import javax.management.ReflectionException; import org.apache.qpid.management.common.mbeans.ServerInformation; -import org.apache.qpid.management.common.mbeans.UserManagement; import org.apache.qpid.management.ui.ApiVersion; import org.apache.qpid.management.ui.ApplicationRegistry; import org.apache.qpid.management.ui.ManagedBean; @@ -551,7 +550,8 @@ public class MBeanUtility //Detect the value of the 'version' key property on the UserManagement MBean ObjectName. //If present, we have a v1.2 API server. If null, we have a v1.1 API server. - objName = new ObjectName(server.getDomain() + ":type="+ UserManagement.TYPE + ",*"); + //Use an ObjectName pattern (the ?) to match the 'type' and allow this to work for non-admin users + objName = new ObjectName(server.getDomain() + ":type="+ "UserManagemen?" + ",*"); objectInstances = mbsc.queryNames(objName, null); if(objectInstances.size() != 0) -- cgit v1.2.1