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
0b96b6b6
Commit
0b96b6b6
authored
22 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
Chasing a referral needs both the request and response mutexes.
Unlock and relock... (yuck)
parent
ec63a1f8
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libraries/libldap/request.c
+24
-8
24 additions, 8 deletions
libraries/libldap/request.c
with
24 additions
and
8 deletions
libraries/libldap/request.c
+
24
−
8
View file @
0b96b6b6
...
...
@@ -371,10 +371,18 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc *srvlist, int use_ldsb,
0
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"Call application rebind_proc
\n
"
,
0
,
0
,
0
);
#endif
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock
(
&
ld
->
ld_req_mutex
);
ldap_pvt_thread_mutex_unlock
(
&
ld
->
ld_res_mutex
);
#endif
err
=
(
*
ld
->
ld_rebind_proc
)(
ld
,
bind
->
ri_url
,
bind
->
ri_request
,
bind
->
ri_msgid
,
ld
->
ld_rebind_params
);
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_lock
(
&
ld
->
ld_res_mutex
);
ldap_pvt_thread_mutex_lock
(
&
ld
->
ld_req_mutex
);
#endif
ld
->
ld_defconn
=
savedefconn
;
--
lc
->
lconn_refcnt
;
...
...
@@ -397,10 +405,18 @@ ldap_new_connection( LDAP *ld, LDAPURLDesc *srvlist, int use_ldsb,
0
,
0
,
0
);
#else
Debug
(
LDAP_DEBUG_TRACE
,
"anonymous rebind via ldap_bind_s
\n
"
,
0
,
0
,
0
);
#endif
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock
(
&
ld
->
ld_req_mutex
);
ldap_pvt_thread_mutex_unlock
(
&
ld
->
ld_res_mutex
);
#endif
if
(
ldap_bind_s
(
ld
,
""
,
""
,
LDAP_AUTH_SIMPLE
)
!=
LDAP_SUCCESS
)
{
err
=
-
1
;
}
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_lock
(
&
ld
->
ld_res_mutex
);
ldap_pvt_thread_mutex_lock
(
&
ld
->
ld_req_mutex
);
#endif
ld
->
ld_defconn
=
savedefconn
;
--
lc
->
lconn_refcnt
;
...
...
@@ -701,7 +717,7 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char *
BerElement
*
ber
;
char
**
refarray
=
NULL
;
LDAPConn
*
lc
;
int
rc
,
count
,
i
,
j
;
int
rc
,
count
,
i
,
j
,
id
;
LDAPreqinfo
rinfo
;
ld
->
ld_errno
=
LDAP_SUCCESS
;
/* optimistic */
...
...
@@ -840,8 +856,8 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char *
srv
->
lud_dn
=
LDAP_STRDUP
(
""
);
}
LDAP_NEXT_MSGID
(
ld
,
rc
);
ber
=
re_encode_request
(
ld
,
origreq
->
lr_ber
,
rc
,
LDAP_NEXT_MSGID
(
ld
,
id
);
ber
=
re_encode_request
(
ld
,
origreq
->
lr_ber
,
id
,
sref
,
srv
,
&
rinfo
.
ri_request
);
if
(
ber
==
NULL
)
{
...
...
@@ -866,7 +882,7 @@ ldap_chase_v3referrals( LDAP *ld, LDAPRequest *lr, char **refs, int sref, char *
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_lock
(
&
ld
->
ld_req_mutex
);
#endif
rc
=
ldap_send_server_request
(
ld
,
ber
,
ld
->
ld_msg
id
,
rc
=
ldap_send_server_request
(
ld
,
ber
,
id
,
origreq
,
srv
,
NULL
,
&
rinfo
);
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock
(
&
ld
->
ld_req_mutex
);
...
...
@@ -950,7 +966,7 @@ ldap_chase_referrals( LDAP *ld,
int
sref
,
int
*
hadrefp
)
{
int
rc
,
count
;
int
rc
,
count
,
id
;
unsigned
len
;
char
*
p
,
*
ref
,
*
unfollowed
;
LDAPRequest
*
origreq
;
...
...
@@ -1046,9 +1062,9 @@ ldap_chase_referrals( LDAP *ld,
*
hadrefp
=
1
;
LDAP_NEXT_MSGID
(
ld
,
rc
);
LDAP_NEXT_MSGID
(
ld
,
id
);
ber
=
re_encode_request
(
ld
,
origreq
->
lr_ber
,
rc
,
sref
,
srv
,
&
rinfo
.
ri_request
);
id
,
sref
,
srv
,
&
rinfo
.
ri_request
);
if
(
ber
==
NULL
)
{
return
-
1
;
...
...
@@ -1062,7 +1078,7 @@ ldap_chase_referrals( LDAP *ld,
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_lock
(
&
ld
->
ld_req_mutex
);
#endif
rc
=
ldap_send_server_request
(
ld
,
ber
,
ld
->
ld_msg
id
,
rc
=
ldap_send_server_request
(
ld
,
ber
,
id
,
lr
,
srv
,
NULL
,
&
rinfo
);
#ifdef LDAP_R_COMPILE
ldap_pvt_thread_mutex_unlock
(
&
ld
->
ld_req_mutex
);
...
...
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