Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
A
ac
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OATS-CADC
ac
Commits
314fa342
Commit
314fa342
authored
9 years ago
by
Patrick Dowler
Browse files
Options
Downloads
Patches
Plain Diff
ichanged getGroup to use searchForEntry with base = groupDN
parent
18665865
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapGroupDAO.java
+9
-9
9 additions, 9 deletions
...l-Server/src/ca/nrc/cadc/ac/server/ldap/LdapGroupDAO.java
with
9 additions
and
9 deletions
projects/cadcAccessControl-Server/src/ca/nrc/cadc/ac/server/ldap/LdapGroupDAO.java
+
9
−
9
View file @
314fa342
...
@@ -1012,17 +1012,17 @@ public class LdapGroupDAO<T extends Principal> extends LdapDAO
...
@@ -1012,17 +1012,17 @@ public class LdapGroupDAO<T extends Principal> extends LdapDAO
logger
.
debug
(
"getGroup: "
+
groupDN
.
toNormalizedString
());
logger
.
debug
(
"getGroup: "
+
groupDN
.
toNormalizedString
());
Filter
filter
=
Filter
.
createNOTFilter
(
Filter
.
createPresenceFilter
(
"nsaccountlock"
));
Filter
filter
=
Filter
.
createNOTFilter
(
Filter
.
createPresenceFilter
(
"nsaccountlock"
));
filter
=
Filter
.
createANDFilter
(
filter
,
//
filter = Filter.createANDFilter(filter,
Filter
.
createEqualityFilter
(
"entrydn"
,
groupDN
.
toNormalizedString
()));
//
Filter.createEqualityFilter("entrydn", groupDN.toNormalizedString()));
SearchRequest
searchRequest
=
new
SearchRequest
(
SearchRequest
searchRequest
=
new
SearchRequest
(
config
.
getG
roup
s
DN
(),
SearchScope
.
SUB
,
filter
,
GROUP_ATTRS
);
g
roupDN
.
toNormalizedString
(),
SearchScope
.
SUB
,
filter
,
GROUP_ATTRS
);
searchRequest
.
addControl
(
searchRequest
.
addControl
(
new
ProxiedAuthorizationV2RequestControl
(
"dn:"
+
new
ProxiedAuthorizationV2RequestControl
(
"dn:"
+
getSubjectDN
().
toNormalizedString
()));
getSubjectDN
().
toNormalizedString
()));
SearchResult
result
=
getConnection
().
search
(
searchRequest
);
SearchResult
Entry
result
=
getConnection
().
search
ForEntry
(
searchRequest
);
if
(
result
==
null
)
if
(
result
==
null
)
{
{
...
@@ -1030,18 +1030,18 @@ public class LdapGroupDAO<T extends Principal> extends LdapDAO
...
@@ -1030,18 +1030,18 @@ public class LdapGroupDAO<T extends Principal> extends LdapDAO
logger
.
debug
(
msg
);
logger
.
debug
(
msg
);
throw
new
GroupNotFoundException
(
groupDN
.
toNormalizedString
());
throw
new
GroupNotFoundException
(
groupDN
.
toNormalizedString
());
}
}
if
(
result
.
getEntryCount
()
==
0
)
//
if (result.getEntryCount() == 0)
throw
new
GroupNotFoundException
(
groupDN
.
toString
());
//
throw new GroupNotFoundException(groupDN.toString());
SearchResultEntry
sre
=
result
.
getSearchEntries
().
get
(
0
);
//
SearchResultEntry sre = result.getSearchEntries().get(0);
if
(
s
re
.
getAttribute
(
"nsaccountlock"
)
!=
null
)
if
(
re
sult
.
getAttribute
(
"nsaccountlock"
)
!=
null
)
{
{
// TODO: logger.error() + throw GroupNotFoundException instead?
// TODO: logger.error() + throw GroupNotFoundException instead?
throw
new
RuntimeException
(
"BUG: found group with nsaccountlock set: "
+
groupDN
.
toString
());
throw
new
RuntimeException
(
"BUG: found group with nsaccountlock set: "
+
groupDN
.
toString
());
}
}
Group
g
=
createGroup
(
s
re
);
Group
g
=
createGroup
(
re
sult
);
logger
.
debug
(
"found: "
+
g
.
getID
());
logger
.
debug
(
"found: "
+
g
.
getID
());
return
g
;
return
g
;
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment