Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
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
Christopher Ng
OpenLDAP
Commits
73207c71
Commit
73207c71
authored
22 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
Replace HACK in slap_sasl_canonicalize with safer test.
parent
ab80b030
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
servers/slapd/sasl.c
+17
-10
17 additions, 10 deletions
servers/slapd/sasl.c
with
17 additions
and
10 deletions
servers/slapd/sasl.c
+
17
−
10
View file @
73207c71
...
...
@@ -818,17 +818,24 @@ slap_sasl_canonicalize(
if
(
auxvals
[
which
].
values
)
goto
done
;
if
(
flags
==
SASL_CU_AUTHZID
)
{
/* If we got unqualified authzid's, they probably came from SASL
* itself just passing the authcid to us. Look inside the oparams
* structure to see if that's true. (HACK: the out_len pointer is
* the address of a member of a sasl_out_params_t structure...)
/* Normally we require an authzID to have a u: or dn: prefix.
* However, SASL frequently gives us an authzID that is just
* an exact copy of the authcID, without a prefix. We need to
* detect and allow this condition. If SASL calls canonicalize
* with SASL_CU_AUTHID|SASL_CU_AUTHZID this is a no-brainer.
* But if it's broken into two calls, we need to remember the
* authcID so that we can compare the authzID later. We store
* the authcID temporarily in conn->c_sasl_dn. We necessarily
* finish Canonicalizing before Authorizing, so there is no
* conflict with slap_sasl_authorize's use of this temp var.
*/
sasl_out_params_t
dummy
;
int
offset
=
(
void
*
)
&
dummy
.
ulen
-
(
void
*
)
&
dummy
.
authid
;
char
**
authid
=
(
void
*
)
out_len
-
offset
;
if
(
*
authid
&&
!
strcmp
(
in
,
*
authid
)
)
goto
done
;
if
(
flags
==
SASL_CU_AUTHID
)
{
conn
->
c_sasl_dn
.
bv_val
=
in
;
}
else
if
(
flags
==
SASL_CU_AUTHZID
&&
conn
->
c_sasl_dn
.
bv_val
)
{
rc
=
strcmp
(
in
,
conn
->
c_sasl_dn
.
bv_val
);
conn
->
c_sasl_dn
.
bv_val
=
NULL
;
/* They were equal, no work needed */
if
(
!
rc
)
goto
done
;
}
rc
=
slap_sasl_getdn
(
conn
,
(
char
*
)
in
,
inlen
,
(
char
*
)
user_realm
,
&
dn
,
...
...
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