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
Quanah Gibson-Mount
OpenLDAP
Commits
ef60ec1d
Commit
ef60ec1d
authored
Sep 23, 2021
by
Ondřej Kuzník
Browse files
ITS#9600 Protect connection while interacting with it
parent
6cc6ec2f
Changes
1
Hide whitespace changes
Inline
Side-by-side
servers/lloadd/monitor.c
View file @
ef60ec1d
...
...
@@ -536,6 +536,14 @@ lload_monitor_conn_modify( Operation *op, SlapReply *rs, Entry *e, void *priv )
{
Modifications
*
m
;
LloadConnection
*
c
=
priv
;
int
rc
=
SLAP_CB_CONTINUE
;
epoch_t
epoch
;
if
(
!
acquire_ref
(
&
c
->
c_refcnt
)
)
{
/* Shutting down, pretend it's already happened */
return
LDAP_NO_SUCH_OBJECT
;
}
epoch
=
epoch_join
();
for
(
m
=
op
->
orm_modlist
;
m
;
m
=
m
->
sml_next
)
{
struct
berval
closing
=
BER_BVC
(
"closing"
);
...
...
@@ -546,14 +554,19 @@ lload_monitor_conn_modify( Operation *op, SlapReply *rs, Entry *e, void *priv )
if
(
m
->
sml_desc
!=
ad_olmConnectionState
||
m
->
sml_op
!=
LDAP_MOD_REPLACE
||
m
->
sml_numvals
!=
1
||
ber_bvcmp
(
&
m
->
sml_nvalues
[
0
],
&
closing
)
)
{
return
LDAP_OTHER
;
rc
=
LDAP_CONSTRAINT_VIOLATION
;
goto
done
;
}
if
(
lload_connection_close
(
c
,
&
gentle
)
)
{
return
LDAP_OTHER
;
rc
=
LDAP_OTHER
;
goto
done
;
}
}
return
SLAP_CB_CONTINUE
;
done:
RELEASE_REF
(
c
,
c_refcnt
,
c
->
c_destroy
);
epoch_leave
(
epoch
);
return
rc
;
}
/*
...
...
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