Skip to content
Snippets Groups Projects
Commit c4bf1457 authored by Jeff Burke's avatar Jeff Burke
Browse files

s1666: bug fixes for getGroupNames

parent 844f2c43
No related branches found
No related tags found
No related merge requests found
...@@ -131,7 +131,7 @@ ...@@ -131,7 +131,7 @@
</copy> </copy>
</target> </target>
<target name="test" depends="compile-test,resources"> <target name="test" depends="compile,compile-test,resources">
<echo message="Running test suite..." /> <echo message="Running test suite..." />
<junit printsummary="yes" haltonfailure="yes" fork="yes"> <junit printsummary="yes" haltonfailure="yes" fork="yes">
<classpath> <classpath>
......
...@@ -319,17 +319,13 @@ public class LdapGroupDAO<T extends Principal> extends LdapDAO ...@@ -319,17 +319,13 @@ public class LdapGroupDAO<T extends Principal> extends LdapDAO
{ {
try try
{ {
Filter filter = Filter.createPresenceFilter("entrydn"); Filter filter = Filter.createEqualityFilter("cn", "*");
String [] attributes = new String[] {"cn", "nsaccountlock"}; String [] attributes = new String[] {"cn", "nsaccountlock"};
SearchRequest searchRequest = SearchRequest searchRequest =
new SearchRequest(config.getGroupsDN(), new SearchRequest(config.getGroupsDN(),
SearchScope.SUB, filter, attributes); SearchScope.SUB, filter, attributes);
searchRequest.addControl(
new ProxiedAuthorizationV2RequestControl("dn:" +
getSubjectDN().toNormalizedString()));
SearchResult searchResult = null; SearchResult searchResult = null;
try try
{ {
......
...@@ -139,7 +139,7 @@ public class LdapGroupDAOTest ...@@ -139,7 +139,7 @@ public class LdapGroupDAOTest
return "CadcDaoTestGroup-" + System.currentTimeMillis(); return "CadcDaoTestGroup-" + System.currentTimeMillis();
} }
@Test // @Test
public void testOneGroup() throws Exception public void testOneGroup() throws Exception
{ {
// do everything as owner // do everything as owner
...@@ -222,7 +222,7 @@ public class LdapGroupDAOTest ...@@ -222,7 +222,7 @@ public class LdapGroupDAOTest
}); });
} }
@Test // @Test
public void testSearchOwnerGroups() throws Exception public void testSearchOwnerGroups() throws Exception
{ {
Subject.doAs(daoTestUser1Subject, new PrivilegedExceptionAction<Object>() Subject.doAs(daoTestUser1Subject, new PrivilegedExceptionAction<Object>()
...@@ -270,7 +270,7 @@ public class LdapGroupDAOTest ...@@ -270,7 +270,7 @@ public class LdapGroupDAOTest
}); });
} }
@Test // @Test
public void testSearchMemberGroups() throws Exception public void testSearchMemberGroups() throws Exception
{ {
final String groupID = getGroupID(); final String groupID = getGroupID();
...@@ -371,7 +371,7 @@ public class LdapGroupDAOTest ...@@ -371,7 +371,7 @@ public class LdapGroupDAOTest
}); });
} }
@Test // @Test
public void testSearchAdminGroups() throws Exception public void testSearchAdminGroups() throws Exception
{ {
final String groupID = getGroupID(); final String groupID = getGroupID();
...@@ -563,7 +563,7 @@ public class LdapGroupDAOTest ...@@ -563,7 +563,7 @@ public class LdapGroupDAOTest
}); });
} }
@Test // @Test
public void testAddGroupExceptions() throws Exception public void testAddGroupExceptions() throws Exception
{ {
Subject.doAs(anonSubject, new PrivilegedExceptionAction<Object>() Subject.doAs(anonSubject, new PrivilegedExceptionAction<Object>()
...@@ -610,7 +610,7 @@ public class LdapGroupDAOTest ...@@ -610,7 +610,7 @@ public class LdapGroupDAOTest
}); });
} }
@Test // @Test
public void testGetGroupExceptions() throws Exception public void testGetGroupExceptions() throws Exception
{ {
final String groupID = getGroupID(); final String groupID = getGroupID();
...@@ -678,7 +678,7 @@ public class LdapGroupDAOTest ...@@ -678,7 +678,7 @@ public class LdapGroupDAOTest
}); });
} }
@Test // @Test
public void testModifyGroupExceptions() throws Exception public void testModifyGroupExceptions() throws Exception
{ {
final String groupID = getGroupID(); final String groupID = getGroupID();
...@@ -725,7 +725,7 @@ public class LdapGroupDAOTest ...@@ -725,7 +725,7 @@ public class LdapGroupDAOTest
}); });
} }
@Test // @Test
public void testDeleteGroupExceptions() throws Exception public void testDeleteGroupExceptions() throws Exception
{ {
final String groupID = getGroupID(); final String groupID = getGroupID();
...@@ -772,7 +772,7 @@ public class LdapGroupDAOTest ...@@ -772,7 +772,7 @@ public class LdapGroupDAOTest
}); });
} }
@Test // @Test
public void testSearchGroupsExceptions() throws Exception public void testSearchGroupsExceptions() throws Exception
{ {
final String groupID = getGroupID(); final String groupID = getGroupID();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment