Skip to content

Commit

Permalink
cadc-access-control-server: handle invalid group names in ldap
Browse files Browse the repository at this point in the history
  • Loading branch information
pdowler committed Oct 20, 2023
1 parent ff1372b commit 961f1e5
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion cadc-access-control-server/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ sourceCompatibility = 1.8

group = 'org.opencadc'

version = '1.3.33'
version = '1.3.34'

description = 'OpenCADC User+Group server library'
def git_url = 'https://github.com/opencadc/ac'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,9 @@ public Group getGroup(final int gid)

Group ldapGroup = createGroupFromSearchResult(searchEntry, PUB_GROUP_ATTRS, ldapConn);
return ldapGroup;

} catch (IllegalArgumentException ex) {
// invalid group name
throw new GroupNotFoundException("porobably invalid group name: " + ex);
} catch (LDAPException e1) {
logger.debug("getGroup Exception: " + e1, e1);
LdapDAO.checkLdapResult(e1.getResultCode());
Expand Down Expand Up @@ -867,9 +869,10 @@ private Group getGroup(final DN groupDN, final String loggableID, String[] attri
profiler.checkpoint("getGroup.addMembers");

return ldapGroup;
}
catch (LDAPException e1)
{
} catch (IllegalArgumentException ex) {
// invalid group name
throw new GroupNotFoundException("porobably invalid group name: " + ex);
} catch (LDAPException e1) {
logger.debug("getGroup Exception: " + e1, e1);
LdapDAO.checkLdapResult(e1.getResultCode());
throw new RuntimeException("BUG: checkLdapResult didn't throw an exception");
Expand Down

0 comments on commit 961f1e5

Please sign in to comment.