Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue 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
Lukas However
OpenLDAP
Commits
20351a05
Commit
20351a05
authored
24 years ago
by
Kurt Zeilenga
Browse files
Options
Downloads
Patches
Plain Diff
SASL: me thinks I got the states okay... now to test.
parent
42a20681
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
servers/slapd/bind.c
+26
-11
26 additions, 11 deletions
servers/slapd/bind.c
servers/slapd/sasl.c
+9
-6
9 additions, 6 deletions
servers/slapd/sasl.c
with
35 additions
and
17 deletions
servers/slapd/bind.c
+
26
−
11
View file @
20351a05
...
...
@@ -216,28 +216,24 @@ do_bind(
ldap_pvt_thread_mutex_lock
(
&
conn
->
c_mutex
);
if
(
conn
->
c_sasl_bind_mech
!=
NULL
)
{
assert
(
conn
->
c_sasl_bind_in_progress
);
if
((
strcmp
(
conn
->
c_sasl_bind_mech
,
mech
)
!=
0
))
{
/* mechanism changed, cancel in progress bind */
conn
->
c_sasl_bind_in_progress
=
0
;
free
(
conn
->
c_sasl_bind_mech
);
conn
->
c_sasl_bind_mech
=
NULL
;
#ifdef HAVE_CYRUS_SASL
sasl_dispose
(
&
conn
->
c_sasl_bind_context
);
conn
->
c_sasl_bind_context
=
NULL
;
#endif
}
free
(
conn
->
c_sasl_bind_mech
);
conn
->
c_sasl_bind_mech
=
NULL
;
#ifdef LDAP_DEBUG
}
else
{
assert
(
!
conn
->
c_sasl_bind_in_progress
);
assert
(
conn
->
c_sasl_bind_mech
==
NULL
);
#ifdef HAVE_CYRUS_SASL
}
else
{
assert
(
conn
->
c_sasl_bind_context
==
NULL
);
#endif
#endif
}
ldap_pvt_thread_mutex_unlock
(
&
conn
->
c_mutex
);
edn
=
NULL
;
...
...
@@ -245,9 +241,25 @@ do_bind(
if
(
rc
==
LDAP_SUCCESS
&&
edn
!=
NULL
)
{
ldap_pvt_thread_mutex_lock
(
&
conn
->
c_mutex
);
#ifdef HAVE_CYRUS_SASL
assert
(
conn
->
c_sasl_bind_context
==
NULL
);
#endif
conn
->
c_dn
=
edn
;
ldap_pvt_thread_mutex_unlock
(
&
conn
->
c_mutex
);
}
else
if
(
rc
==
LDAP_SASL_BIND_IN_PROGRESS
)
{
#ifdef HAVE_CYRUS_SASL
assert
(
conn
->
c_sasl_bind_context
!=
NULL
);
#endif
conn
->
c_sasl_bind_mech
=
mech
;
mech
=
NULL
;
#ifdef HAVE_CYRUS_SASL
}
else
{
assert
(
conn
->
c_sasl_bind_context
!=
NULL
);
#endif
}
goto
cleanup
;
}
else
{
...
...
@@ -257,15 +269,18 @@ do_bind(
if
(
conn
->
c_sasl_bind_mech
!=
NULL
)
{
assert
(
conn
->
c_sasl_bind_in_progress
);
/* cancel in progress bind */
conn
->
c_sasl_bind_in_progress
=
0
;
free
(
conn
->
c_sasl_bind_mech
);
conn
->
c_sasl_bind_mech
=
NULL
;
#ifdef HAVE_CYRUS_SASL
assert
(
conn
->
c_sasl_bind_context
!=
NULL
);
sasl_dispose
(
&
conn
->
c_sasl_bind_context
);
conn
->
c_sasl_bind_context
=
NULL
;
#endif
}
else
{
assert
(
!
conn
->
c_sasl_bind_in_progress
);
#ifdef HAVE_CYRUS_SASL
assert
(
conn
->
c_sasl_bind_context
==
NULL
);
#endif
}
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/sasl.c
+
9
−
6
View file @
20351a05
...
...
@@ -144,7 +144,7 @@ int sasl_bind(
Debug
(
LDAP_DEBUG_ARGS
,
"==> sasl_bind: dn=%s, mech=%s, cred->bv_len=%d
\n
"
,
dn
,
mech
,
cred
?
cred
->
bv_len
:
0
);
if
(
conn
->
c_sasl_bind_context
)
{
if
(
conn
->
c_sasl_bind_context
==
NULL
)
{
sasl_callback_t
callbacks
[
4
];
int
cbnum
=
0
;
...
...
@@ -210,6 +210,9 @@ int sasl_bind(
NULL
,
NULL
,
NULL
,
NULL
);
}
else
{
Debug
(
LDAP_DEBUG_TRACE
,
"<== sasl_bind: username=%s
\n
"
,
authzid
,
0
,
0
);
if
(
strncasecmp
(
authzid
,
"anonymous"
,
sizeof
(
"anonyous"
)
-
1
)
&&
(
(
authzid
[
sizeof
(
"anonymous"
)]
==
'\0'
)
||
(
authzid
[
sizeof
(
"anonymous"
)]
==
'@'
)
)
)
...
...
@@ -224,15 +227,15 @@ int sasl_bind(
}
}
else
if
(
sc
==
SASL_CONTINUE
)
{
/*
* We set c_sasl_bind_in_progress because it doesn't appear
* that connection.c sets this (unless do_bind() itself
* returns LDAP_SASL_BIND_IN_PROGRESS).
*/
send_ldap_sasl
(
conn
,
op
,
rc
=
LDAP_SASL_BIND_IN_PROGRESS
,
NULL
,
NULL
,
NULL
,
NULL
,
&
response
);
}
if
(
sc
!=
SASL_CONTINUE
&&
conn
->
c_sasl_bind_context
!=
NULL
)
{
sasl_dispose
(
&
conn
->
c_sasl_bind_context
);
conn
->
c_sasl_bind_context
=
NULL
;
}
Debug
(
LDAP_DEBUG_TRACE
,
"<== sasl_bind: rc=%d
\n
"
,
rc
,
0
,
0
);
return
rc
;
...
...
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