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
0
Merge Requests
0
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
Boxiang Sun
gitlab-ce
Commits
a0d7a22e
Commit
a0d7a22e
authored
Sep 20, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Always downcase DNs
parent
91f2492a
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
10 deletions
+12
-10
lib/gitlab/ldap/dn.rb
lib/gitlab/ldap/dn.rb
+12
-10
No files found.
lib/gitlab/ldap/dn.rb
View file @
a0d7a22e
...
@@ -37,10 +37,12 @@ module Gitlab
...
@@ -37,10 +37,12 @@ module Gitlab
buffer
<<
"="
if
index
%
2
==
1
buffer
<<
"="
if
index
%
2
==
1
buffer
<<
","
if
index
%
2
==
0
&&
index
!=
0
buffer
<<
","
if
index
%
2
==
0
&&
index
!=
0
arg
=
args
[
index
].
downcase
if
index
<
args
.
length
-
1
||
index
%
2
==
1
if
index
<
args
.
length
-
1
||
index
%
2
==
1
buffer
<<
self
.
class
.
escape
(
arg
s
[
index
]
)
buffer
<<
self
.
class
.
escape
(
arg
)
else
else
buffer
<<
arg
s
[
index
]
buffer
<<
arg
end
end
end
end
...
@@ -60,7 +62,7 @@ module Gitlab
...
@@ -60,7 +62,7 @@ module Gitlab
case
state
case
state
when
:key
then
when
:key
then
case
char
case
char
when
'a'
..
'z'
,
'A'
..
'Z'
then
when
'a'
..
'z'
then
state
=
:key_normal
state
=
:key_normal
key
<<
char
key
<<
char
when
'0'
..
'9'
then
when
'0'
..
'9'
then
...
@@ -72,7 +74,7 @@ module Gitlab
...
@@ -72,7 +74,7 @@ module Gitlab
when
:key_normal
then
when
:key_normal
then
case
char
case
char
when
'='
then
state
=
:value
when
'='
then
state
=
:value
when
'a'
..
'z'
,
'
A'
..
'Z'
,
'
0'
..
'9'
,
'-'
,
' '
then
key
<<
char
when
'a'
..
'z'
,
'0'
..
'9'
,
'-'
,
' '
then
key
<<
char
else
raise
"DN badly formed"
else
raise
"DN badly formed"
end
end
when
:key_oid
then
when
:key_oid
then
...
@@ -110,14 +112,14 @@ module Gitlab
...
@@ -110,14 +112,14 @@ module Gitlab
end
end
when
:value_normal_escape
then
when
:value_normal_escape
then
case
char
case
char
when
'0'
..
'9'
,
'a'
..
'f'
,
'A'
..
'F'
then
when
'0'
..
'9'
,
'a'
..
'f'
then
state
=
:value_normal_escape_hex
state
=
:value_normal_escape_hex
hex_buffer
=
char
hex_buffer
=
char
else
state
=
:value_normal
;
value
<<
char
else
state
=
:value_normal
;
value
<<
char
end
end
when
:value_normal_escape_hex
then
when
:value_normal_escape_hex
then
case
char
case
char
when
'0'
..
'9'
,
'a'
..
'f'
,
'A'
..
'F'
then
when
'0'
..
'9'
,
'a'
..
'f'
then
state
=
:value_normal
state
=
:value_normal
value
<<
"
#{
hex_buffer
}#{
char
}
"
.
to_i
(
16
).
chr
value
<<
"
#{
hex_buffer
}#{
char
}
"
.
to_i
(
16
).
chr
else
raise
"DN badly formed"
else
raise
"DN badly formed"
...
@@ -130,7 +132,7 @@ module Gitlab
...
@@ -130,7 +132,7 @@ module Gitlab
end
end
when
:value_quoted_escape
then
when
:value_quoted_escape
then
case
char
case
char
when
'0'
..
'9'
,
'a'
..
'f'
,
'A'
..
'F'
then
when
'0'
..
'9'
,
'a'
..
'f'
then
state
=
:value_quoted_escape_hex
state
=
:value_quoted_escape_hex
hex_buffer
=
char
hex_buffer
=
char
else
else
...
@@ -139,14 +141,14 @@ module Gitlab
...
@@ -139,14 +141,14 @@ module Gitlab
end
end
when
:value_quoted_escape_hex
then
when
:value_quoted_escape_hex
then
case
char
case
char
when
'0'
..
'9'
,
'a'
..
'f'
,
'A'
..
'F'
then
when
'0'
..
'9'
,
'a'
..
'f'
then
state
=
:value_quoted
state
=
:value_quoted
value
<<
"
#{
hex_buffer
}#{
char
}
"
.
to_i
(
16
).
chr
value
<<
"
#{
hex_buffer
}#{
char
}
"
.
to_i
(
16
).
chr
else
raise
"DN badly formed"
else
raise
"DN badly formed"
end
end
when
:value_hexstring
then
when
:value_hexstring
then
case
char
case
char
when
'0'
..
'9'
,
'a'
..
'f'
,
'A'
..
'F'
then
when
'0'
..
'9'
,
'a'
..
'f'
then
state
=
:value_hexstring_hex
state
=
:value_hexstring_hex
value
<<
char
value
<<
char
when
' '
then
state
=
:value_end
when
' '
then
state
=
:value_end
...
@@ -159,7 +161,7 @@ module Gitlab
...
@@ -159,7 +161,7 @@ module Gitlab
end
end
when
:value_hexstring_hex
then
when
:value_hexstring_hex
then
case
char
case
char
when
'0'
..
'9'
,
'a'
..
'f'
,
'A'
..
'F'
then
when
'0'
..
'9'
,
'a'
..
'f'
then
state
=
:value_hexstring
state
=
:value_hexstring
value
<<
char
value
<<
char
else
raise
"DN badly formed"
else
raise
"DN badly formed"
...
...
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