Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
9a68cad8
Commit
9a68cad8
authored
Apr 14, 2016
by
Drew Blessing
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some additional checking for LDAP DNs in Group Sync
parent
faad5120
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
7 deletions
+13
-7
lib/gitlab/ldap/group_sync.rb
lib/gitlab/ldap/group_sync.rb
+13
-7
No files found.
lib/gitlab/ldap/group_sync.rb
View file @
9a68cad8
require
'net/ldap/dn'
module
Gitlab
module
LDAP
class
GroupSync
...
...
@@ -181,13 +183,17 @@ module Gitlab
# account for that. See gitlab-ee#442
def
ensure_full_dns!
(
dns
)
dns
.
map!
do
|
dn
|
# If there is more than one equal sign we must have a full DN
# Or at least the probability is higher.
return
dn
if
dn
.
count
(
'='
)
>
1
# If there is only one equal sign, we may only have a `uid`.
# In this case, strip the first part and look up full DN by UID
dn_for_uid
(
dn
.
split
(
'='
)[
1
])
parsed_dn
=
Net
::
LDAP
::
DN
.
new
(
dn
).
to_a
# If there is more than one key/value set we must have a full DN,
# or at least the probability is higher.
if
parsed_dn
.
count
>
2
dn
elsif
parsed_dn
[
0
]
==
'uid'
dn_for_uid
(
parsed_dn
[
1
])
else
logger
.
warn
{
"Found potentially malformed/incomplete DN: '
#{
dn
}
'"
}
dn
end
end
end
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment