Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Robert Dubner
OpenLDAP
Commits
4a02ae13
Commit
4a02ae13
authored
Feb 01, 2021
by
Ondřej Kuzník
Browse files
ITS#6518 When using proxyauthz, replace existing control
parent
20ec1289
Changes
1
Hide whitespace changes
Inline
Side-by-side
servers/slapd/back-ldap/bind.c
View file @
4a02ae13
...
@@ -2803,7 +2803,7 @@ ldap_back_controls_add(
...
@@ -2803,7 +2803,7 @@ ldap_back_controls_add(
LDAPControl
**
ctrls
=
NULL
;
LDAPControl
**
ctrls
=
NULL
;
/* set to the maximum number of controls this backend can add */
/* set to the maximum number of controls this backend can add */
LDAPControl
c
[
2
]
=
{
{
0
}
};
LDAPControl
c
[
2
]
=
{
{
0
}
};
int
n
=
0
,
i
,
j1
=
0
,
j2
=
0
;
int
n
=
0
,
i
,
j1
=
0
,
j2
=
0
,
skipped
=
0
;
*
pctrls
=
NULL
;
*
pctrls
=
NULL
;
...
@@ -2893,12 +2893,21 @@ ldap_back_controls_add(
...
@@ -2893,12 +2893,21 @@ ldap_back_controls_add(
i
=
0
;
i
=
0
;
if
(
op
->
o_ctrls
)
{
if
(
op
->
o_ctrls
)
{
LDAPControl
*
proxyauthz
=
ldap_control_find
(
LDAP_CONTROL_PROXY_AUTHZ
,
op
->
o_ctrls
,
NULL
);
for
(
i
=
0
;
op
->
o_ctrls
[
i
];
i
++
)
{
for
(
i
=
0
;
op
->
o_ctrls
[
i
];
i
++
)
{
ctrls
[
i
+
j1
]
=
op
->
o_ctrls
[
i
];
if
(
proxyauthz
&&
proxyauthz
==
op
->
o_ctrls
[
i
]
)
{
/* Frontend has already checked only one is present */
assert
(
skipped
==
0
);
skipped
++
;
continue
;
}
ctrls
[
i
+
j1
-
skipped
]
=
op
->
o_ctrls
[
i
];
}
}
}
}
n
+=
j1
;
n
+=
j1
-
skipped
;
if
(
j2
)
{
if
(
j2
)
{
ctrls
[
n
]
=
(
LDAPControl
*
)
&
ctrls
[
n
+
j2
+
1
]
+
j1
;
ctrls
[
n
]
=
(
LDAPControl
*
)
&
ctrls
[
n
+
j2
+
1
]
+
j1
;
*
ctrls
[
n
]
=
c
[
j1
];
*
ctrls
[
n
]
=
c
[
j1
];
...
...
Write
Preview
Supports
Markdown
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